Moving from setState to Riverpod in Flutter Part 2

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 27. 07. 2024
  • Part 2 of the Riverpod series covers few useful features of the package including:
    .family modifier - send extra data to your provider
    .autodispose modifier - control what happens to the state when the provider is no longer being used
    reference other providers inside of providers
    Using the useProvider hook to replace the Consumer widget
    00:00 - intro and looking at docs
    01:25 - HookWidget and useProvider hook
    06:08 - creating a new FutureProvider
    07:53 - Passing extra data with the family modifier
    11:48 - Referencing one provider from another
    13:57 - Choosing how to persist state with autoDispose
    đŸ’»Follow along here with the initial code: github.com/theflutterfactory/...
    ⚡Connect on Facebook: / flutterfactory
    ⚡Connect on Twitter: / flutterfactory
    đŸŽ·Music: www.bensound.com

Komentáƙe • 13

  • @kemids2842
    @kemids2842 Pƙed 3 lety +2

    more riverpod i love your tutorials

  • @rsocial453
    @rsocial453 Pƙed 2 lety

    Thank you❀

  • @ArielLindo
    @ArielLindo Pƙed 3 lety

    great video, very clear explaining the concepts!, thanks!

  • @KrastyoKrastev
    @KrastyoKrastev Pƙed 3 lety

    Great video! Thank you a lot!

  • @susantimilsina3913
    @susantimilsina3913 Pƙed 3 lety +2

    hello sir, we want more videos of hooks_riverpod with dummys api found on net...Use more of hook widgets

  • @RandalLSchwartz
    @RandalLSchwartz Pƙed 3 lety +1

    At 1:45, there is indeed a HookStateWidget to replace a StatefulWidget that together with HookState to replace State, is nearly a drop-in replacement.

    • @TheFlutterFactory
      @TheFlutterFactory  Pƙed 3 lety +1

      Good point. I haven't played around with flutter Hooks too much outside the context of RiverPod.

  • @talatkuyuk6556
    @talatkuyuk6556 Pƙed 3 lety +1

    I am really interested in riverpod. I am trying to handle a registration form in a MVVM pattern with riverpod. Keep on your videos, thanks.

  • @RandalLSchwartz
    @RandalLSchwartz Pƙed 3 lety

    At 4:30, be sure to NEVER get into the habit to type "() => {}" even as a placeholder. Either "() => ()" or "() {}". The problem is that "() => {}" is legal syntax to return an empty Map from the function when it is called. Ouch!

  • @ericchua3492
    @ericchua3492 Pƙed 3 lety

    Noticed "flutter UserList rebuilds..." each time page changes when click List, any idea why? flutter_hook issue?

    • @TheFlutterFactory
      @TheFlutterFactory  Pƙed 3 lety

      Good question. There's more way to optimize the rebuilds. Wrapping the entire UserList widget (not just the return value) would be one way to prevent that UserList from rebuilding until the list is updated

    • @ericchua3492
      @ericchua3492 Pƙed 3 lety

      @@TheFlutterFactory any gist sample?