Thank you for this excellent tutorial. How it should be done. It seems the world of flutter and in particular flutter_bloc changes a bit rapidly. I just went through the video, and it looks like with Cubit now merging into the Bloc library, there are some renames here and there. In particular, imports for flutter_bloc cover cubit as well. onTransition are now onChange. CubitObserver is BlocObserver, CubitBuilder is BlocBuilder, CubitListener is BlocListener. In the pubspec, you only need flutter_bloc: ^6.0.1
@FlutterExplained4 жыл бұрын
Thank you I will take an eye on it :)
@ookamiueru4 жыл бұрын
@@FlutterExplained i might be a bit confused myself. It looks like cubit is now part of bloc, and flutter_bloc integrates with both cubit and bloc. Either can be used interchangeably, so your tutorial will work with the renames I mentioned. One could also use Bloc instead, but that adds a layer of events that need to be mapped to states. A little bit more heavy handed, but could solve particular use cases. The recommendation according to docs is to, if unsure, start out with Cubits, and convert them on a need basis to Blocs. It's such a great work to have these somewhat overlapping solutions to be consolidated into one coherent solution. Absolutely great stuff
@FlutterExplained4 жыл бұрын
@@ookamiueru You are right, the problem was that this video was released exactly one week before the merge into BloC has been announced, so I had not the time yet to update the tutorial. But I will as soon as I find the opportunity. Sorry for the inconvenience and thanks for your fantastic explanation of what to do, I will pin your comment so that everyone who joins that video can see your solution.
@ookamiueru4 жыл бұрын
@@FlutterExplained it was of no inconvenience. I had some familiarity with the concept, so the mapping to the changes was fairly straight forward. I'm just happy you made the tutorial, as even with the changes, I still find it to be a great explanation for how it works. It's just a few renames :-)
@FlutterExplained4 жыл бұрын
@@ookamiueru Amazing :) I am super happy that it helped you.
@josegeorges59144 жыл бұрын
I love felix and love this! He's been my pilar on flutter dev and can't thank him enough for such a smooth path onto Flutter!
@ezzypoo79094 жыл бұрын
Apart from the great tutorial, it’s also fantastic to see this guy get better at speaking while being recorded. Based off the accent it sounds like English is his second language and in his first videos it definitely shows, but now in more recent videos you can barely tell. Always nice to see people improving in areas besides coding!
@FlutterExplained4 жыл бұрын
I don't even know what to say, thank you so much! That was one of the biggest compliments that you could give me :). I believe to write a script beforehand helps to improve the language, and I hope I can transfer that to my live streams as well :)
@vireshpeshen57384 жыл бұрын
Just when i was finding a cubit tutorial , i found yours
@AbhideepChakravarty3 жыл бұрын
Felt like looking into a solution without knowing the problem well. Somehow I could not learn watching it once. Only thing I felt, there are things to be learnt.
@FlutterExplained3 жыл бұрын
Sorry to hear that, I will see if I can improve it whenever I do my Bloc Video. Thank you very much for your feedback!
@danilakalish10914 жыл бұрын
You can use the todo tree extension to better control the todo in visual code
@huycao85212 жыл бұрын
Thank you sir for a very clear tutorial !
@FlutterExplained2 жыл бұрын
You are welcome!
@xcodesnippets8634 жыл бұрын
Great Tutorial man. Subbed. Regarding viewing the Todos, you can use the Todo Tree extension for VS code to view them without having to search it.
@FlutterExplained4 жыл бұрын
Fantastic I will have a look! Thanks for sharing.
@xcodesnippets8634 жыл бұрын
Glad I could be of help. Also, looking forward to your video on Riverpod, if you ever decide to make one that is.
@pol12ris4 жыл бұрын
Nice one... btw that was quick... Cubit just got released and we have a video also. cool.
@theredcap_yt4 жыл бұрын
You can use TODO Tree Extension in VS Code
@KawsarAhmed-qq4sj4 жыл бұрын
Thanks for excellent tutorial. you guys done wonderful job. your accent and explanation is good and understandable. can you please make another video or update this video with latest flutter_bloc.
@FlutterExplained4 жыл бұрын
Thank you it is great to hear that you enjoyed it :).
@himanshumistry33363 жыл бұрын
CubitProvider is BlocProvider(need to import package), MainCubitOberver is MainObserver
@FlutterExplained3 жыл бұрын
There have been a great update on the repository in our state tutorial from David it should now follow the correct use cases :)
@LeagueRandomPlayer4 жыл бұрын
Great video dude!
@fredericklane7453 жыл бұрын
For those of us new to Cubit, maybe at the beginning of the video, show how it actually functions on the app and maybe present a graphical of how it works in the back-end?
@marctan70012 жыл бұрын
thanks for this! what do you prefer in flutter? redux or cubit?
@jrheisler4 жыл бұрын
Interesting, a nice Cubit video, thanks, and on the same day a Riverpod video from someone else. Will there ever be only one?
@FlutterExplained4 жыл бұрын
Most likely not :) there are a lot of people doing great stuff.
@petroniobonavides35304 жыл бұрын
@Flutter Explained Hello, Dont you know GetX? State simple/reactive management(without codegen), route Management and Dependencies management 3-IN-1. This is a hidden and powerful tool that nobody talks about. Could please do some content. This package is gonna surprise you, definitely... Thx a lot
@FlutterExplained4 жыл бұрын
Thanks for pointing that out, we will absolutely take a look into it, and it is already in our Pipeline.
@FlutterExplained4 жыл бұрын
I had a conversation with Felix, and he found some additions. I mutated the state which you should not to, check out the Repository I added the hotfix and improved the solutions with this. You can find the addition in the link below: github.com/md-weber/state_tutorials/pull/2
@MohammedJavad3 жыл бұрын
Everyone please be aware that flutter_cubit is discontinued and its been merged with flutter_bloc
@MrVipulLal Жыл бұрын
Very good video
@FlutterExplained Жыл бұрын
Thanks mate :)
@tessertaha4 жыл бұрын
Great video!
@HimanshuYT4 жыл бұрын
Awesome! ❤️
@adbysantos66033 жыл бұрын
Good video!
4 жыл бұрын
Cubit is very good :D
@yooscripts59474 жыл бұрын
nice tutorial but i could not find flutter_cubit on pub.dev i think they merge it into flutter_bloc so i used it but CubitObserver does not exit on
@FlutterExplained4 жыл бұрын
That could be I think with the merge into BloC it works now with the Bloc Observer: Bloc.observer = MyBlocObserver(); pub.dev/packages/bloc#overview
@programan63914 жыл бұрын
NIce tutorial. So, cubit can replace bloc? It's much more clean.
@FlutterExplained4 жыл бұрын
Well, it will not replace it, but it gives you an alternative if you do not want to have the huge boilerplate with Events. It is useful if you want to work with a lightweight solution. But keep in mind there will be additional changes because it is currently in version 0.1 and Felix is working actively on it. Therefore it could lead to breaking changes in the future.
@gokulakrishnan19774 жыл бұрын
what is the font or extension you using ( I like this => )
@FlutterExplained4 жыл бұрын
That is Fira Code Medium with Font Ligratures. I created a video how to add that in your IDE. twitter.com/flutter_exp/status/1252857128131256321?s=19
@elmeroranchero3 жыл бұрын
will that rebuild the whole thing if a new drink is added?
@FlutterExplained3 жыл бұрын
Good question, I would have to check that once more it has been a while :)
@elmeroranchero3 жыл бұрын
@@FlutterExplained I would appreciate a deep look at this kind of problem in a future video. :)
@soheibbettahar19964 жыл бұрын
The flutter_cubit packages is marked discontinued ::
@FlutterExplained4 жыл бұрын
That is correct you can find it in the Bloc package now it has been merged in the other comments you can find how to change it to the correct package :)
@nepalcodetv62984 жыл бұрын
flutter with rest api which state management should i use? like realestate app
@FlutterExplained4 жыл бұрын
Any, if you are beginner I would recommend try it to solve with StatefulWidgets and if it is not enough anymore try to improve with a more advanced solution like Provider, BloC or MobX.
@dudubaiao4 жыл бұрын
I think you should have used immutability all the way down. Having only the list immutable is not enough if you mutate the drink object directly.
@FlutterExplained4 жыл бұрын
That is correct, I think I added somewhere a comment or changed it already in the GitHub repository. Maybe I will update this video at some time :)
@elmeroranchero3 жыл бұрын
What does "...state" do in the children section of the Column?
@FlutterExplained3 жыл бұрын
Hi Daniel, (...) is a so called spread operator, and it flattens a list into its single elements. Feel free to have a look here: dart.dev/guides/language/language-tour#spread-operator
@elmeroranchero3 жыл бұрын
@@FlutterExplained yeah I understand the spread operator but why do we need it there, can´t we just pass state as it is?
@FlutterExplained3 жыл бұрын
Unfortunately no, because the state is from type List of drinks but we use the map on the state and return for each drink a widget that can be spread into the list of the Column.
@elmeroranchero3 жыл бұрын
@@FlutterExplained but can't it be state.map etc ? Maybe I'm missing something very obvious
@amarpreetsingh8573 жыл бұрын
If aap restart data lost in cubit?
@FlutterExplained3 жыл бұрын
Yes Cubit is just a state management tool, not a Database. For that you will use something like Hive or SharedPreferences or a real Database like Firebase or a Server with Postgre.