Managing State in Flutter - Introducing Flutter

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 109

  • @flutterdev
    @flutterdev  2 ปีที่แล้ว +17

    Begin learning Flutter → goo.gle/LearnFlutter

    • @bahaeddinsagar
      @bahaeddinsagar ปีที่แล้ว +2

      looks like no new videos for this series

  • @KhanhFlutter
    @KhanhFlutter 2 ปีที่แล้ว +94

    Hi y'all! I just wanted to say thank you for keeping the dialogue going on this video and keeping things respectful! I know state management can be a contentious topic where we can have strong, varying opinions. Naturally, I was a bit hesitant taking on this video 🫣 but seeing the responses and conversations on your preferred state management tell me that the effort has paid off :) Thank you for being an awesome community with such a welcoming environment!

    • @lawofattractionspace
      @lawofattractionspace 2 ปีที่แล้ว +2

      Thanks Khanh Nguyen, great content, it's helpful.

    • @momomumu8656
      @momomumu8656 2 ปีที่แล้ว +1

      thank your latest update after one year:)

    • @yorjanis5194
      @yorjanis5194 2 ปีที่แล้ว

      One question, can I translate your video into Spanish so that my students can see it on TH-cam to upload it?

    • @cookiesnuggles1
      @cookiesnuggles1 ปีที่แล้ว

      Woooo go Khannie!

    • @KhanhFlutter
      @KhanhFlutter ปีที่แล้ว +1

      @@yorjanis5194 Hey, Yorjanis! First, thank you for watching the video and liking it enough to want to translate it for your students :) Second, we actually have Spanish subtitles on this video now! The translations for our videos can sometimes be a bit delayed so it may not have been there yet when you watched the video. Hope this helps your students!

  • @akshaysrivastavaofficial
    @akshaysrivastavaofficial 2 ปีที่แล้ว +41

    I was having two options: React or Flutter. And I am glad I chose Flutter. This is one of the most amazing and energetic community of developers. No doubt Flutter will touch skies in the coming years.

    • @KhanhFlutter
      @KhanhFlutter ปีที่แล้ว +3

      Thank you for being a part of our amazing and energetic community of developers!

  • @Lensbreak
    @Lensbreak 2 ปีที่แล้ว +15

    Got a big smile on my face when i saw that you are "promoting" riverpod on this official channel. Best state management solution for flutter for sure!

  • @_dinesh
    @_dinesh 2 ปีที่แล้ว +7

    This is an awesome explanation! Very easy to understand. Althought if you have team with mixed expertise. Then using riverpod can quickly get messy and then you have to reinvent the concepts of how to structure your code. In bloc, the standards are well defined. You have 3 files - State, Events and the bloc. Anyone starts new does have to feel like they are lost in the woods when looking at the code.

    • @squallsamas
      @squallsamas 2 ปีที่แล้ว +1

      I completely agree about BLoC. Awesome pattern and awesome library for flutter.

  • @devyb-cc
    @devyb-cc 2 ปีที่แล้ว +15

    For me, Riverpod is a breath of fresh air. I came from Provider, and it will become a mess quickly. I find it a little more exhaustive on debugging than Riverpod.
    Also, I like the concept of AsyncValue in Riverpod.

    • @merthyr1831
      @merthyr1831 2 ปีที่แล้ว +3

      They're both really good state management solutions, but Riverpod is definitely very opinionated in how you write models. Provider lets you control things a bit more but with the risk of messier model design.

    • @devyb-cc
      @devyb-cc 2 ปีที่แล้ว

      @@merthyr1831 no doubt, in my opinion Riverpod and Provider have less boilerplate and "etc" package than other state management.

  • @akaneritsuki
    @akaneritsuki 2 ปีที่แล้ว +4

    riverpod is rock solid! we use it in prod for over a year already 🤞
    Now only thing that I wish for is static metaprogramming, since it'd makes riverpod even more intuitive to use.

  • @littlebearandchicken2077
    @littlebearandchicken2077 ปีที่แล้ว +6

    Nice video. At this time I still prefer to use Bloc mainly because it works so well in teams.
    It's more opinionated than Riverpod which (I guess) makes it less flexible but when working in teams or in situations where another developer is going to have to look at my code half a year from now it's really nice because it forces the developers to write code in a certain way, which creates consistency. That consistency is important so that the developers can understand each other's code better without running into surprises.

    • @andrewbrogdon558
      @andrewbrogdon558 ปีที่แล้ว +2

      Yep, plenty to like about flutter_bloc! There's a reason both it and Riverpod are Flutter Favorite packages. :)

  • @ultimaterex
    @ultimaterex 2 ปีที่แล้ว +26

    Riverpod is fantastic, great video

    • @rudinandrey
      @rudinandrey 2 ปีที่แล้ว

      GetX better :-)

    • @okie9025
      @okie9025 2 ปีที่แล้ว +14

      @@rudinandrey getx is bad in general, not just for state management

    • @marflage
      @marflage 2 ปีที่แล้ว

      @@rudinandrey could you please explain why?

    • @RafiesAwesomeChannel
      @RafiesAwesomeChannel 2 ปีที่แล้ว

      There's even riverpod hooks!

    • @rudinandrey
      @rudinandrey 2 ปีที่แล้ว

      @@marflage easy to use. tools must to be easy. a lot of usefull tools like routing and so on.

  • @mesurajyadav
    @mesurajyadav 2 หลายเดือนก่อน

    What a simple natural way to explain. Thanks a lot!

  • @filiphracek
    @filiphracek ปีที่แล้ว +10

    Thanks for this video, Khanh! Extremely gnarly topic, well explained. And it's clear you took great care in striking the balance between giving people useful advice, and starting a flame war. Cheers!
    P.S.: Seeing the provider and consumer blobs put a big smile on my face!

  • @franklinoladipo2343
    @franklinoladipo2343 2 ปีที่แล้ว +2

    Just started riverpod and it has been awesome!!

  • @BrunoCodeman
    @BrunoCodeman 2 ปีที่แล้ว +4

    Riverpod is definitely the best state management library available for flutter

    • @rdrgbaioco
      @rdrgbaioco ปีที่แล้ว

      definitely not.

    • @BrunoCodeman
      @BrunoCodeman ปีที่แล้ว +1

      @@rdrgbaioco What would you recommend? Google itself recommends riverpod.

    • @gintoki_sakata__
      @gintoki_sakata__ 10 หลายเดือนก่อน

      ​@@BrunoCodemanbloc

  • @matteoborghi3942
    @matteoborghi3942 5 หลายเดือนก่อน

    When I understood the watch I felt a rock lifted from my heart, it felt so easy

  • @anmolkapoor1068
    @anmolkapoor1068 2 ปีที่แล้ว +3

    Scoped model, provider, inherited widgets are usually my go to choices

    • @andrewbrogdon558
      @andrewbrogdon558 ปีที่แล้ว +1

      If you're using scoped_model, you must have been coding with Flutter for a while! It's a great package, but definitely one of the oldest approaches to state management.

  • @bennguyen1313
    @bennguyen1313 2 ปีที่แล้ว +4

    I understand Google recommends Provider.. but with so many state management tools and approaches, it would be nice to have guidelines for best practices.

    • @linuxsever5727
      @linuxsever5727 2 ปีที่แล้ว +3

      Riverpod is a better "provider". I recommend it.

  • @alvin3171997
    @alvin3171997 2 ปีที่แล้ว +3

    Love Blocs and Riverpod, but still use Redux + Epics combo in production :D

  • @reggieholm6245
    @reggieholm6245 4 หลายเดือนก่อน +1

    This video was very helpful with all that info condensed in 5 mins. I wish there was corresponding code as with previous videos.
    I have 2 errors in the main.dart file
    TaskItem has a red squiggly line underneath.
    The progress bar does not work.

    • @flutterdev
      @flutterdev  3 หลายเดือนก่อน

      Hey there! Glad you found the video helpful! Check out the GitHub repository here → goo.gle/3H02gUe. It was hiding under the description's Show More button!

  • @guycz
    @guycz ปีที่แล้ว +2

    Great solution for state management =)

  • @valirmasha4718
    @valirmasha4718 2 ปีที่แล้ว +1

    Need more like this to learn flutter

  • @devflix5316
    @devflix5316 2 ปีที่แล้ว +4

    Flutter's UI code, out-of-box support and documentation are awesome. Plus I love coding in dart. Still can't use in webdev cause after build its heavy and slow, specially lag in animation. Really hope it gets better and better. Although mobile and desktop builds seem fine.

  • @JaysKitchenCooks
    @JaysKitchenCooks ปีที่แล้ว +1

    anyone has the link for the last part of this intro to flutter series? cant seem to find it anywhere

  • @saqqara6361
    @saqqara6361 2 ปีที่แล้ว +3

    Great video... also using Riverpod right now...

  • @sukruozgundemirel684
    @sukruozgundemirel684 2 ปีที่แล้ว +3

    You are great. I have been working with state management solutions for a long time understanding little of it. This video makes understanding those solutions pretty easy and I am thankful for that. Keep up those videos! :D

  • @miladhesami6630
    @miladhesami6630 2 ปีที่แล้ว +1

    I'm using BLoC and it's scalable and easy to use. I suggest to check its toturials because you learn how to develop application using feature driven architecture

  • @dolbysoundsofficial9323
    @dolbysoundsofficial9323 2 ปีที่แล้ว +1

    Riverpod is best State management Solutions

  • @RaymondAtivie
    @RaymondAtivie 2 ปีที่แล้ว +6

    Riverpod!🎉

  • @JuanFcoRomero
    @JuanFcoRomero 2 ปีที่แล้ว +1

    Awesome explanation for beginners!

  • @aytunch
    @aytunch 2 ปีที่แล้ว +4

    Nice concise video. But my goto choice is still cubits. Perfect for bigger apps. You can have full control. And UI is more separated from business logic.

    • @adnanjpg
      @adnanjpg 2 ปีที่แล้ว +2

      can you elaborate on how cubits are better for bigger apps?

    • @aytunch
      @aytunch 2 ปีที่แล้ว +1

      @@adnanjpg Unlike blocs, cubits don't require boilerplate code. And in reality you will rarely need blocs(only for some complex stream input manipulations) Also you have better control of you state object with cubit/bloc. You can allow your widget tree to rebuild on only specific events. lastly, the business logic code lives on its own files, seperate from UI. You never need to call infrastructure code from UI. testing is a breeze.

    • @rsajdok
      @rsajdok ปีที่แล้ว

      @@aytunch nothing special, riverpod has is

  • @s8x.
    @s8x. 2 หลายเดือนก่อน

    do i need to install riverpod?

  • @rmedola
    @rmedola ปีที่แล้ว

    GetBuilder state managment???? Is the better. Please talk about

  • @2005sty
    @2005sty ปีที่แล้ว

    Why does the code rebuild the list of checkboxs for just one user check action? If I added thousand of items throughout my life, it is going to be slow when I check.

  • @naveedislam9697
    @naveedislam9697 7 หลายเดือนก่อน

    And here I was using shared preferences 😅 for this.

  • @isakhansson917
    @isakhansson917 2 ปีที่แล้ว +2

    Just use kmm with compose...

  • @winter_t
    @winter_t ปีที่แล้ว +1

    Riverpod 🤩

  • @adolfomotanavarro6553
    @adolfomotanavarro6553 ปีที่แล้ว +1

    "Let's pick up where we left last time"
    I see what you did there

    • @dilshadxahmad
      @dilshadxahmad 8 หลายเดือนก่อน +1

      😅 Forcing us poor lads to watch the previous one?

    • @adolfomotanavarro6553
      @adolfomotanavarro6553 8 หลายเดือนก่อน

      @@dilshadxahmad no dude, I meant that she's talking about states

    • @dilshadxahmad
      @dilshadxahmad 8 หลายเดือนก่อน

      @@adolfomotanavarro6553 ok dude, my bad.

  • @rod5751
    @rod5751 2 ปีที่แล้ว +1

    Well this is going to be contentious.....

  • @resyncmedia
    @resyncmedia ปีที่แล้ว

    I would love to have a course like Google Garage about Flutter 🙏🏻

  • @cesaltinofelix
    @cesaltinofelix ปีที่แล้ว

    *I NEED HELP!*
    hi guys, i'm beginner on flutter development and i am just trying to implement what we are learning on this video ( flutter state management using flutter_riverpod), but i got an error in my StateNotifierProvider. could anyone help me ?
    obs: I'm learning english too, sorry for any mistake i've made. kkk

  • @FauziJabbar
    @FauziJabbar ปีที่แล้ว

    and the what's function of setState? kasih tau dong yg tau :(
    apakah harus menggunakan state management untuk handle errorMessage

  • @pipzgutz
    @pipzgutz 2 ปีที่แล้ว

    What's the title of video from previous?

    • @KhanhFlutter
      @KhanhFlutter 2 ปีที่แล้ว +1

      It's this video! th-cam.com/video/QlwiL_yLh6E/w-d-xo.html "What is State?"

  • @anoniem012
    @anoniem012 ปีที่แล้ว

    Where is the source code of this task project?

  • @gabrielfernandoalicuchallo6363
    @gabrielfernandoalicuchallo6363 ปีที่แล้ว +1

    No sabia que un tutorial podia iniciar con el final y terminar con el inicio, para alguien que inicia en Flutter esto es catastrofico. Porque pre-asumimos que dichas Clases Task and TaskNotifier podrian ser nombres reservados.

  • @whitenoiseconnoisseur
    @whitenoiseconnoisseur 9 หลายเดือนก่อน

    I just realized Riverpod is an anagram for Provider 🤯

    • @dilshadxahmad
      @dilshadxahmad 8 หลายเดือนก่อน

      Me too realized that only few months ago. Cutely Genius tho.

  • @Вальдемар-п6г
    @Вальдемар-п6г ปีที่แล้ว

    Great! thank you.

  • @일하기싫어24
    @일하기싫어24 2 ปีที่แล้ว

    Please make a flutter splash screen animation tutorial. 😊

  • @abdelazizkayoueche8317
    @abdelazizkayoueche8317 2 ปีที่แล้ว

    Good keep going.

  • @smt515n5
    @smt515n5 ปีที่แล้ว

    What is next video?

  • @oreofesolarin
    @oreofesolarin 2 ปีที่แล้ว +1

    🎉

  • @verticrow
    @verticrow 2 ปีที่แล้ว

    Awesome!

  • @vetiam
    @vetiam 2 ปีที่แล้ว +1

    ✊🏾🔥🔥🔥

  • @Kiriyaki65548
    @Kiriyaki65548 2 ปีที่แล้ว

    Nice!

  • @aryabp
    @aryabp 2 ปีที่แล้ว +2

    introducing tauri 🗿

  • @faheemahmad3957
    @faheemahmad3957 2 ปีที่แล้ว

    Please teach us from Start like beginner please make

    • @KhanhFlutter
      @KhanhFlutter ปีที่แล้ว

      Hey there! What type of content would you like to see for beginners?

  • @1s_enough
    @1s_enough 2 ปีที่แล้ว

    👍👍

  • @ErCapoAlex
    @ErCapoAlex 2 ปีที่แล้ว

    Up

  • @manhtran2780
    @manhtran2780 ปีที่แล้ว

    flutter translate vietnamese very few

  • @Samudbhava
    @Samudbhava ปีที่แล้ว +1

    does not explain how _TaskItemState extends State needs to be changed to support WidgetRef paramenter in build. This is where learning something becomes frustrating and all the hard work and easy explanations become an insult to someone who just wants to learn. the out of sequence presentation of changes makes it much worse. if you are showcasing your framework, please dont label it as a tutorial.

    • @KhanhFlutter
      @KhanhFlutter ปีที่แล้ว +2

      Hey there! I'll make a note to clarify that up front next time so to not be misleading. Just to share my motivation behind this video, I hadn't intended on the video being a full Riverpod tutorial since there's already so much great content from the community which covers it. I wanted to share the concept of state management and RiverPod was a good way to show a more concrete example of the concepts that I discussed, so I glossed over a lot of the implementation details. Plus, we would've needed more than 5 minutes to cover everything ;) Thank you for sharing that feedback, I really appreciate it!

    • @pixobit5882
      @pixobit5882 6 หลายเดือนก่อน

      I have the same problem. What changed do need to be made? I'm stuck...

    • @pixobit5882
      @pixobit5882 6 หลายเดือนก่อน

      For everyone in the future:
      1. Change your TaskItem to extend ConsumerWidget
      2. Remove the createState() method from TaskItem
      3. Move the build() method from _TaskItemState to TaskItem
      4. Delete _TaskItemState, it is not needed anymore.
      5. (It not already done, make changes to Checkbox seen in video at 4:44)
      6. Change "widget.label" from Text to "task.label"
      I home this helped someone!

  • @talatelbeick6829
    @talatelbeick6829 2 ปีที่แล้ว +3

    riverpod to me is the worse choose for many reasons, we loose encapsulation and a lot of OOP concepts. The best solution I can suggest for maintainable project is to make providers as privet other ways you don't know in which place you change the state.

    • @BooleanDev
      @BooleanDev 2 ปีที่แล้ว +1

      what do you mean by you loose encapsulation and OOP concepts? Providers just give access to an object instance

    • @remirousselet6867
      @remirousselet6867 2 ปีที่แล้ว +3

      Feel free to provide counter arguments, but I'd argue that's false. You do know what modifies your state: The StateNotifier. Nothing else can modify it..

    • @talatelbeick6829
      @talatelbeick6829 2 ปีที่แล้ว +1

      @@remirousselet6867 It's true that I know by what my state is changed, but I cannot know or force it to be changed form a specific part of the app, obviously if my provider is public I'm able to change its state from any place in the app. Thanks!

    • @remirousselet6867
      @remirousselet6867 2 ปีที่แล้ว +2

      ​@@talatelbeick6829 Depends. If you're referring to "scoping an object to only one screen", you can do that in Riverpod.
      It's not true that you can change the state from any place.

    • @talatelbeick6829
      @talatelbeick6829 2 ปีที่แล้ว +1

      @@remirousselet6867 Interesting, how can I be sure that X provider is changed only in deceleration file?

  • @catbb
    @catbb ปีที่แล้ว

    came from scopedModel. then provider. then to inheritedWidget. with streamControllers. basically provider of my own