Тёмный
No video :(

Flutter BLoC/Cubit Tutorial with REST API and Repository Pattern 

heyletscode
Подписаться 14 тыс.
Просмотров 55 тыс.
50% 1

In this video, you will learn everything about the bloc pattern in #flutter and by the end of this video, you will become confident enough to start using the #bloc pattern in your own flutter apps.
Github repository link:
github.com/hey...
Download NodeJS:
nodejs.org
Flutter Routing Explained in 3 Minutes!
• Flutter Routing Explai...
Allow Insecure HTTP:
Android: android:usesCleartextTraffic="true" (Add this under application tag)
iOS: gist.github.co...
Follow me on social media:
/ heyletscode
www.github.com...
/ _heyletscode
/ heyletscode
Contents of this video:
00:00 - Introduction
01:25 - App showcase
03:01 - Set up the JSON server
08:30 - Create the project and install required extensions
09:28 - Folder structure and app screens
14:10 - Set up navigation routes
17:00 - Coding the todos screen
19:15 - Intro to cubits
23:40 - Add flutter_bloc library in the project
24:58 - Create the first cubit
26:38 - BlocProvider
29:05 - Repository, network service and todo model
31:20 - Fetching todos from server
46:28 - BlocBuilder
55:45 - Completing todo on swipe
1:04:00 - Add todo screen
1:16:55 - BlocListener
1:19:47 - Edit todo screen
1:33:25 - Run on a real device
1:35:00 - MultiBlocProvider & BlocConsumer

Опубликовано:

 

13 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 82   
@gabrielribeiro8619
@gabrielribeiro8619 2 года назад
Thank you, i was looking for a Router tutorial but this is the best I found. Helped me a lot. Thanks from Brazil!
@shnylljenner1704
@shnylljenner1704 2 года назад
The most difficult state management is explained in very simple way... well done man!
@houdinifilm5545
@houdinifilm5545 3 года назад
thank you for this video , i am from cameroon an i realy realy like it , please continue like that . I undersstand Bloc/Cubit pattern Well now .
@himanshudhakecha1789
@himanshudhakecha1789 7 месяцев назад
informative and useful....thanks for posting
@Skema1114
@Skema1114 3 года назад
Incredible video, I really liked how you pass on the knowledge because you can see that you really know what you are talking about and explaining. This tutorial helped me a lot and I am also subscribed to follow more videos. Congratulations friend and continue teaching other people, this is incredible.
@daxtonrhett5690
@daxtonrhett5690 3 года назад
I know I'm kinda off topic but does anyone know a good site to watch new movies online?
@sawyerkaleb2057
@sawyerkaleb2057 3 года назад
@Daxton Rhett Flixportal
@daxtonrhett5690
@daxtonrhett5690 3 года назад
@Sawyer Kaleb Thank you, I signed up and it seems like they got a lot of movies there :D Appreciate it !!
@sawyerkaleb2057
@sawyerkaleb2057 3 года назад
@Daxton Rhett glad I could help xD
@ferryaprilianto
@ferryaprilianto 2 года назад
Great video to learn how to implement bloc & repository patterns. Thanks a lot
@deepmehta1540
@deepmehta1540 Год назад
hey i am getting an error type 'TodosInitial' is not a subtype of type 'TodosLoaded' in type cast while doing final todos = (state as TodosLoaded).todos; in todoscreen can you please help me with it !!
@BounceIO
@BounceIO 3 года назад
Amazing tutorial, very grateful for creators like you!
@santhanamgunasekaran6074
@santhanamgunasekaran6074 2 года назад
I like your content and clear pronunciation. thanks
@ujjwalyadav920
@ujjwalyadav920 2 года назад
explained so easily, thank you so much brother …👍🏻
@NATAR160
@NATAR160 2 года назад
I love this tutorial but im almost becoming blind trying to pick out the texts of the codes bc they so tiny. I wished he always zoom to make the text clearer to see. Somebody help me if there's anyway I can zoom in on the video from youtube app on my mobile.
@iam_etukz
@iam_etukz 2 года назад
How are you dealing with null safety in this codes
@rtcodes4618
@rtcodes4618 2 года назад
thanks! anybody else get the error "The default value of an optional parameter must be constant." for " MyApp({required this.repository = Repository(networkService: NetworkService())});" in main.dart?
@francodebuono8020
@francodebuono8020 3 года назад
excellent video, it would be good a series of videos making different apps to show what would be bloc (cubits) in depth.
@muhammadissasabbagh1540
@muhammadissasabbagh1540 3 года назад
It's an extremely advanced tutorial, thanks a lot
@t3nl33
@t3nl33 2 года назад
Can you help me, why my screen is not re-build after changing the isCompleted or adding a new todo in a list? should I change my screen class into stateful widget? how to set the setState though?
@rp2804
@rp2804 3 года назад
Under rated channel
@shashidhare3074
@shashidhare3074 Год назад
can we use both BlockBuilder and BlocListner in single UI screen?
@icantthinkofaname9624
@icantthinkofaname9624 3 года назад
hey, I have to make an AR app in android studio, and since you are the king of AR in android studio, I wanted to ask you, how can we make a AR app using vuforia in android studio? there are no videos on this, and I think yours would be the first one. I want on how to make an app with vuforia in android studio, especially the model target part, since that is the most wanted feature of vuforia
@zaheeruddinbaber6762
@zaheeruddinbaber6762 2 года назад
Hi, amazing video. How to upload image to a post rest api using bloC?
@mustafatahir3294
@mustafatahir3294 Год назад
Excellent explaination!!
@devasatrio4163
@devasatrio4163 2 года назад
please make login with flutter bloc, i like your tutorial, it realy helpfull
@dharmikthakkar3642
@dharmikthakkar3642 3 года назад
Nicely Explained
@MohdShahid-xm8dm
@MohdShahid-xm8dm 2 года назад
Very nice tutorial. Can you make a tutorial where you can use data of multiple states in a single view? For example in MultiBlocProvider we can provide multiple blocs but how can we use it in the builder? For example: if we have to show the Logged in user name on the todos list page somewhere at the top then we will need to create Users cubit and we have to pass the Users data also on the todos list page. Thanks Mihir.
@ifeanyiagu378
@ifeanyiagu378 3 года назад
Great stuff... Well explained.
@krishkapadia5704
@krishkapadia5704 2 года назад
is there any way to store data (which came from api) without defining modal and stores in cubit like react js / react native ?
@qadirkrimov6448
@qadirkrimov6448 3 года назад
Thanks forr greeaat tutorial. Bro, which db do you use? I use moor,but in my opinion hive is best. What do you think? And if I want to add db files to my project, I will add to "data" folder like this tutorial? Thanks for attention
@nguyenlee6934
@nguyenlee6934 3 года назад
hey bro, can you give me a background of video when the video is starting, thanks you so much!!!
@syedshiblimahmud7918
@syedshiblimahmud7918 2 года назад
you are awesome!
@AshishDhiman1107
@AshishDhiman1107 3 года назад
Nice tutorial. Can you make tutorial on pagination using cubit
@heyletscode
@heyletscode 3 года назад
Pagination using cubit - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-PCDRFz9jhLc.html
@justinharshit5611
@justinharshit5611 2 года назад
@@heyletscode id it good thing to learn node js as backend for flutter ?
@chrisrn3226
@chrisrn3226 2 года назад
How can I implement Firestore using this same architecture? Amazing video btw
@thecseacademy
@thecseacademy Год назад
Thank you
@t3nl33
@t3nl33 2 года назад
Hi great videos, thank you brother
@alpitanand20
@alpitanand20 2 года назад
Really awesome.
3 года назад
Nice tutorial, thanks
@gaetanguiffo9378
@gaetanguiffo9378 2 года назад
Amazing and thanks.
@ashrafmakandar3370
@ashrafmakandar3370 3 года назад
Please make a video on how to make custom shapes using custom clipper
@RahulKumar-mn3gz
@RahulKumar-mn3gz 2 года назад
how to call multiple api on Home Screen.
@FathiAlamre
@FathiAlamre 3 года назад
Thanks, No another way to access list of tods from anouter cubits ??
@heyletscode
@heyletscode 3 года назад
the flutter_bloc library doesn’t provide a default way for cubit to cubit communication. But we can have our own implementation for it
@FathiAlamre
@FathiAlamre 3 года назад
@@heyletscode We can use getIt package for it ??
@heyletscode
@heyletscode 3 года назад
yes get_it can be used
@karanv293
@karanv293 2 года назад
hey bro, can you do a cubit series with authentication, etc. basicallly real world scenarios using cubit
@abdelrhmnallam6416
@abdelrhmnallam6416 2 года назад
thanks
@priyamagiya4193
@priyamagiya4193 3 года назад
hey could you also create a video on creating a video call app for android using flutter and webrtc
@godfironsstream-a7915
@godfironsstream-a7915 3 года назад
bro can we make 3d game in Android studio please tell me bro 👏ಥ_ಥ
@heyletscode
@heyletscode 3 года назад
Use unity or unreal for game development
@CRPF_97
@CRPF_97 3 года назад
@@heyletscode Thanks you very much
@nabinkarki1196
@nabinkarki1196 2 года назад
wonderful.love from nepal.Jay nepal,jay flutter,jay bloc
@sachindeveloperko8424
@sachindeveloperko8424 3 года назад
Brother Can you make tutorial in hindi because we clear basic concept
@bhagavanreddy104
@bhagavanreddy104 3 года назад
MVVM or bloc with cubit which is the best architecture to develop flutter app...suggest me...?
@heyletscode
@heyletscode 3 года назад
bloc is better to work with in flutter
@KehindeAdeoya
@KehindeAdeoya 3 года назад
Thanks for this great tutorial. I'm having a challenge while following it. It returns this error. ```BlocProvider.of() called with a context that does not contain a TodosCubit.``` I have tried resolving it, please help as it hasn't been resolved. I Think this is where the problem is from ```BlocProvider.of(context).fetchTodos();```. It returned the error on the Widget build(BuildContext context) {
@heyletscode
@heyletscode 3 года назад
looks like the widget doesn’t have access to the TodosCubit. Make sure you have provided the cubit to the widget
@vinaybakle6443
@vinaybakle6443 3 года назад
Remove home parameter from main.dart it will go
@tuberk
@tuberk 3 года назад
Make sure you provide the correct context before trying to reach that cubit. Use builder after Providing that cubit to the tree, only then you can reach and use todoscubit.
@kind8735
@kind8735 3 года назад
Cmiiw, you are mutating isCompleted directly in the cubit rather than creating a new state with the updated isCompleted value. Why do you choose this approach instead keeping the states immutable?
@heyletscode
@heyletscode 3 года назад
After updating the isCompleted value on the todo object i have emitted a new state with the previous list of todos (and since the object which was updated in the cubit holds a reference to one of the objects in the todoList, the UI updates when a new state is emitted). If I were to go with a different approach then I would need to create a copy of the todo object with the new isCompleted value then get the list of todos and add the new todo object at the position of the todo object that it was copied from. The first approach seems more straightforward and concise so I decided to go with it
@kind8735
@kind8735 3 года назад
@@heyletscode Thanks for replying. I've been wondering when is a good time to ditch best practice of keeping the states immutable. Great job on the video. I like how you spend the time explaining your thought process while coding.
@heyletscode
@heyletscode 3 года назад
The better practice will always be to keep the states immutable. And the only place where i think mutable states will be better to use is when your application is running very tight on memory and since with immutable states you will require more memory for creating the clones of the data that the state holds. But again this would be a very extreme case and the better practice will always be to keep the states immutable.
@kind8735
@kind8735 3 года назад
@@heyletscode I made a mistake. I thought you were mutating the cubit state. You created a new state and kept the previous one intact. You were just mutating a single Todo instance. Do I finally understand it correctly?
@alpitanand20
@alpitanand20 2 года назад
@@kind8735 Yes i need ans to this as well
@shoxruxquroqov5349
@shoxruxquroqov5349 2 года назад
3:40
@szyszak9424
@szyszak9424 Год назад
24:13
@RahulKumar-mn3gz
@RahulKumar-mn3gz 2 года назад
plz provide this project link.
@heyletscode
@heyletscode 2 года назад
its in description
@RahulKumar-mn3gz
@RahulKumar-mn3gz 2 года назад
@@heyletscode Thanks sir
@rp2804
@rp2804 3 года назад
44:43 Android Manifest file for allowing http requests
@abdelmaouladeraoui5629
@abdelmaouladeraoui5629 3 года назад
this is the code for toast in flutter without using an external package, just use this style ScaffoldMessenger.of(context) .showSnackBar(SnackBar( backgroundColor: Colors.greenAccent, width: 66, behavior: SnackBarBehavior.floating, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: const Radius.circular(25.0), topRight: const Radius.circular(25.0), bottomLeft: const Radius.circular(25.0), bottomRight: const Radius.circular(25.0), ), ), content: Text( "hello", style: TextStyle( color: Colors.green.shade700, fontWeight: FontWeight.bold, ), ), ));
@samsondavidoff372
@samsondavidoff372 2 года назад
You can also use: shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(25.0), ), ... for less boilerplate code :)
@buuumit
@buuumit 2 года назад
type '_InternalLinkedHashMap' is not a subtype of type 'List' in type cast Hello, I have put the json file on my shared hosting and when I try to run your example by changing the baseURL with the complete path of the json online, I receive the error on title but the "response.body" print correctly the json. Why? final baseUrl = "api.buuumit.com/d.json"; Future fetchElements() async { try { final response = await get(Uri.parse(baseUrl)); print(jsonDecode(response.body)); return jsonDecode(response.body) as List; } catch (e) { print(e); return []; } } thx
Далее
I Built a Trampoline Park in My House!
29:50
Просмотров 11 млн
35 Flutter Tips That Will Change Your Life
10:53
Просмотров 299 тыс.
BLoC Pattern with Flutter || State Management
22:50
Просмотров 95 тыс.
Kubernetes 101 workshop - complete hands-on
3:56:03
Просмотров 1,6 млн
REST API with GetX | Flutter tutorial | Shopping app
26:43
Flutter Bloc & Cubit Tutorial
47:58
Просмотров 120 тыс.