Riverpod Tutorial 005 - What's new in version 1.0.0

  Рет қаралды 9,096

Fun with Flutter

Fun with Flutter

Күн бұрын

In this video we go through everything that is new in version 1.0.0 of Riverpod. We look at breaking changes, deprecations, and new features.
Chapters:
0:00 Intro
2:30 Breaking changes v0.14.0
5:08 Scoped Provider replaced with Provider
6:47 ConsumerWidget build method prototype change
8:56 Other breaking changes v1.0.0
10:56 ProviderListener deprecated with ref.listen
13:23 Other deprecations v1.0.0
13:53 ConsumerStatefulWidget and ConsumerState
16:27 Filtering rebuilds with select on providers
17:28 ref.listen inside other providers
30:26 Other new features and changes
---
SUPPORT
Buy Remi a coffee and support Riverpod: www.buymeacoffee.com/remirous...
Buy me a coffee cuz I like coffee:
www.buymeacoffee.com/gordonhayes
--
RIVERPOD TUTORIALS AND CODE
github.com/funwithflutter/riv...
---
SOCIALS
Twitter: / gordonphayes
---
COURSES
courses.funwith.app

Пікірлер: 51
@muzammilhussain7463
@muzammilhussain7463 4 ай бұрын
Truly Awesome Video!!!!
@mellondev
@mellondev 2 жыл бұрын
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 2 жыл бұрын
Ah that's great to hear! Glad they were helpful!
@deepertracks
@deepertracks 2 жыл бұрын
@@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!
@RaymondAtivie
@RaymondAtivie 3 жыл бұрын
Thank you. very helpful video
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
You’re very welcome!
@sovrinfo
@sovrinfo 3 жыл бұрын
Thank you
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
:)
@rajayogan8884
@rajayogan8884 3 жыл бұрын
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 жыл бұрын
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?
@conceptcoder
@conceptcoder 2 жыл бұрын
already subscribe you channel Bro, keep teaching and make good tutorials....
@FunwithFlutter
@FunwithFlutter 2 жыл бұрын
Thanks!
@_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.
@findsarfaraz
@findsarfaraz 2 жыл бұрын
you are using watch. Where as WidgetRef is shown in original documentation. What is correct?
@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 жыл бұрын
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 жыл бұрын
@@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!
@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" ...
@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 жыл бұрын
@@matthewchung74 You'll find one here: github.com/funwithflutter/riverpod_tutorials/blob/main/riverpod_003_async_value/lib/main.dart
@FunwithFlutter
@FunwithFlutter 3 жыл бұрын
@@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
@MisterNorthernCanuck
@MisterNorthernCanuck 2 жыл бұрын
Now if only Navigator 2.0 wasnt an absolute PAIN to manage
@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 жыл бұрын
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 жыл бұрын
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 2 жыл бұрын
@@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.
@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
@BooleanDev
@BooleanDev 2 жыл бұрын
we are now at dev release 1.0.0-dev.7, which is mostly bug fixes
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,7 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
НЫСАНА КОНЦЕРТ 2024
2:26:34
Нысана театры
Рет қаралды 1,4 МЛН
Riverpod Simplified | Easy State Management
14:17
Tadas Petra
Рет қаралды 43 М.
How to become a Mobile App developer? (for dummies)
4:52
Khalid Warsame
Рет қаралды 351
Creator of git, Linus Torvalds Presents the Fundamentals of git
1:10:15
Developers Alliance
Рет қаралды 59 М.
Riverpod 2.0 - Complete Guide (Flutter Tutorial)
1:03:37
Reso Coder
Рет қаралды 109 М.
Learn Flutter Hooks and Maximize Your Code Reuse
10:36
Robert Brunhage
Рет қаралды 61 М.
Enums considered harmful
9:23
Matt Pocock
Рет қаралды 200 М.
State Management Like A Pro - Flutter Riverpod
10:30
Robert Brunhage
Рет қаралды 76 М.
Why The Windows Phone Failed
24:08
Apple Explained
Рет қаралды 175 М.
80 Year Olds Share Advice for Younger Self
12:22
Sprouht
Рет қаралды 1,7 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 7 МЛН