Riverpod Tutorial 005 - What's new in version 1.0.0

Поділитися
Вставка
  • Опубліковано 15 вер 2024

КОМЕНТАРІ • 51

  • @mellondev
    @mellondev 3 роки тому +5

    Awesome video, I’ve been developing over 20 years, new to flutter and watched many videos on riverpod and just couldn’t get my head around it.
    Your videos finally made it click, great examples look forward to seeing your future videos

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      Ah that's great to hear! Glad they were helpful!

    • @deepertracks
      @deepertracks 2 роки тому +1

      @@FunwithFlutter Been developing 10 yrs and same with me. Could not quite get my head totally around it, but these finally made it click for me. Thanks!

    • @FunwithFlutter
      @FunwithFlutter  2 роки тому

      @@deepertracks That's great to hear. You're welcome!

  • @muzammilhussain7463
    @muzammilhussain7463 5 місяців тому

    Truly Awesome Video!!!!

  • @RaymondAtivie
    @RaymondAtivie 3 роки тому +1

    Thank you. very helpful video

  • @findsarfaraz
    @findsarfaraz 2 роки тому

    you are using watch. Where as WidgetRef is shown in original documentation. What is correct?

  • @conceptcoder
    @conceptcoder 2 роки тому +1

    already subscribe you channel Bro, keep teaching and make good tutorials....

  • @rajayogan8884
    @rajayogan8884 3 роки тому +1

    Hey, Great content as always. Thanks man.. !! (On a slightly off topic note, what's the screen recorder you use to capture the screen?)

    • @MohamedDernoun
      @MohamedDernoun 3 роки тому

      OBS studio is good if you want to make such thing

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому +1

      Thanks Raja. I use ScreenFlow, only available on Mac I think. They recently released a new version (I'm still on the old one). Really good software and you can easily do some cool things with it. High res recordings, can zoom in, keystroke capture, highlights. Good investment.

  • @peekpt
    @peekpt 3 роки тому

    Nice resume. Select is awesome

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      Yeah for sure. Riverpod keeps getting better.

    • @peekpt
      @peekpt 3 роки тому

      @@FunwithFlutter but I don't know if it optimizes because any animations triggers needsrepaint several times a second

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      @@peekpt What's the concern using select in a build where there is animation, or using select to do animation?

  • @faizulla5838
    @faizulla5838 2 роки тому

    Hi Broo! You is nice mastery! I can ask about "Wave_slider" ... when a you have plan to abrade this plugin? Flutter 2.5 not accept it because plugin is " not null safety" ...

  • @sovrinfo
    @sovrinfo 3 роки тому +1

    Thank you

  • @_birdy_birdy
    @_birdy_birdy 3 роки тому

    Does riverpod help to solve such a problem where I need to pass any primitive like double down 2/3 widgets? I break my widgets many parts and I struggle when animation I just need one single primitive I can't do it with provider because it's generic.

  • @oscarh4066
    @oscarh4066 3 роки тому

    Great video. Question, is the intention now that for me to only read a provider, I need access to WidgetRef, right? So there is no alternative, like there was before with context.read which could be used from inside Stateless widget. Or do I have to be inside either a ConsumerWidget/ConsumerStatefulWidget/Consumer, in order to just to a read?

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому +1

      Thanks! And yes, you're correct. You would now always need some ref to perform a read. No longer possible with context.

    • @oscarh4066
      @oscarh4066 3 роки тому +1

      @@FunwithFlutter Good to know! Just refactored my current project to use the latest, your video was very helpful. Thanks again.

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      @@oscarh4066 You're very welcome!

  • @MisterNorthernCanuck
    @MisterNorthernCanuck 2 роки тому

    Now if only Navigator 2.0 wasnt an absolute PAIN to manage

  • @rickberger4081
    @rickberger4081 3 роки тому

    I still don't understand the difference between ref.watch and ref.listen, and use cases for each. Can you further explain?

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      ref.listen won't cause the build function to be called again. Which is something you want to avoid, as a general practice. ref.listen also mean you can manipulate state easily on certain events that come through

  • @matthewchung74
    @matthewchung74 3 роки тому

    one more follow up question, if I am doing a ref.listen of the same provider in several different pages (navigator 2.0), how do I prevent rebuilds in all those pages? I'd ideally like to rebuild only when they become visible.

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      .autoDispose on the provider

    • @matthewchung74
      @matthewchung74 3 роки тому

      @@FunwithFlutter thanks, but if a page is pushed onto the navigation stack, it is not disposed. it only is disposed when popped off.

  • @gentashandi
    @gentashandi 3 роки тому

    Thanks for tutorial man. Can I ask you something about ProviderListener/ref.listen, I have two login provider listener at two different file (for login screen and after register confirmation screen), but register confirmation screen listening to Login ProviderListener from the file itself and also from from login screen. How to make ProviderListener only be listened locally (only same file/screen)?

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому +1

      Hmmm depends, but some things you can look into are making the providers private (so _ ), only access them in that file then. And the also adding autodispose to the providers, so that they are destroyed when they are no longer being referenced

    • @gentashandi
      @gentashandi 3 роки тому

      @@FunwithFlutter I'm still confused with making providers private, the thing is my provider is in different file with my screen, can you explain me more about it? And I was already adding autodispose to the providers.

  • @tameflame1229
    @tameflame1229 3 роки тому

    So what do I replace context.read() with in my buttons' onPressed functions? Do i have to wrap my buttons in consumer widgets now?

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      Instead of sending a BuildContext to the button, you would now send the WidgetRef - for ConsumerWidget's. While for ConsumerStatufulWidget the WidgetRef is a property of the ConsumerState class, so you can use ref.read anywhere in that class.

    • @tameflame1229
      @tameflame1229 3 роки тому

      @@FunwithFlutter Thanks. So If (as an example) I have a Scaffold with a body :Column() with children: [button1(), button2()]. Where should I put the consumer? Do all my scaffolds need to have consumer children from now on?

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      No you replace your SatelessWidget with a ConsumerWidget, get the WidgetRef in the build method, and there you go. You can use the ref wherever you want in your build. The Consumer widget is independent and serves a different purpose

    • @alvin3171997
      @alvin3171997 3 роки тому

      @@FunwithFlutter Using the ref in the build method will cause the whole build to rebuild, correct?

  • @matthewchung74
    @matthewchung74 3 роки тому

    Thanks for this! are there any examples of ConsumerStatefulWidget?

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому

      You’ll find some in the repository!

    • @matthewchung74
      @matthewchung74 3 роки тому

      @@FunwithFlutter Thanks, I'm sorry but I can't find the examples in the repository you are referring to. Can you point me to one?

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому +1

      @@matthewchung74 You'll find one here: github.com/funwithflutter/riverpod_tutorials/blob/main/riverpod_003_async_value/lib/main.dart

    • @FunwithFlutter
      @FunwithFlutter  3 роки тому +1

      @@matthewchung74 There are others in the same repo.

  • @kishorkc3419
    @kishorkc3419 3 роки тому

    Thank you for this tutorial.
    please do make
    - a tutorial with flutter_riverpod and connectivity pkg.
    and more logic topic use by flutter_riverpod

  • @BooleanDev
    @BooleanDev 3 роки тому

    we are now at dev release 1.0.0-dev.7, which is mostly bug fixes