Flutter Provider: The Essential Guide

  Рет қаралды 69,225

Andrea Bizzotto

Andrea Bizzotto

Күн бұрын

This tutorial shows how to refactor the default Flutter counter app with Provider, including in-depth explanations about ChangeNotifier, ChangeNotifierProvider, Provider.of, Consumer and ValueNotifier.
HIGHLIGHTS
00:00 - Intro
00:46 - Overview of the counter app
01:47 - Propagating state across widgets (lifting state up vs Provider)
03:48 - Refactoring the counter app
04:50 - Creating a counter class with ChangeNotifier
06:05 - Using ChangeNotifierProvider
07:10 - Using Provider.of
08:32 - Registering widgets as listeners
10:07 - The Consumer widget
11:43 - Quick Recap
13:20 - Using ValueNotifier
15:37 - ValueNotifier under the hood
Join my FREE email course to become a Flutter expert with the best resources, at your own pace: codewithandrea.com/newsletter/
Want more? Check out all my Flutter courses: 👇👇
codewithandrea.com/courses/
Happy coding!

Пікірлер: 160
@AdrianMoya
@AdrianMoya 4 жыл бұрын
Thanks man, the internet needed this tutorial.
@joaorafael6202
@joaorafael6202 4 жыл бұрын
I have an observation: in the ChangeNotifierProvider widget the 'builder'(6:44) argument name is now deprecated, use 'create' instead of 'builder'. By the way, great tutorial, thanks for the time and effort that you given in order to make it!
@abuzar478
@abuzar478 4 жыл бұрын
Thanks man i was really confused about this
@Musicmotivated
@Musicmotivated 4 жыл бұрын
Abuzar Rasool ii
@Musicmotivated
@Musicmotivated 4 жыл бұрын
Abuzar Rasool iii
@Musicmotivated
@Musicmotivated 4 жыл бұрын
Abuzar Rasool iiiiu
@Musicmotivated
@Musicmotivated 4 жыл бұрын
Abuzar Rasool has uto uou iii
@loldotcom955
@loldotcom955 2 жыл бұрын
Best tutorials on provider in the internet
@dannykay4919
@dannykay4919 2 жыл бұрын
I didn't even finish the video as i'm typing this (but am about to). I just had to pause and comment to say this is a great explanation. So many state management techniques out there and some contractors were bringing in things that looked a bit foreign to me. After reading the provider packages documentation and watching this video, stuff seems super simple. Thanks for saving me some time!
@devonedmonds9223
@devonedmonds9223 4 жыл бұрын
This is the single best Provider tutorial I've found thus far. Many thanks Andrea!
@CodeWithAndrea
@CodeWithAndrea 4 жыл бұрын
Thank you. That was my goal.
@agoodmansaid
@agoodmansaid 4 жыл бұрын
@@CodeWithAndrea I totally Agree man, all others are either too long or too complex or both
@chinxeleer
@chinxeleer Жыл бұрын
Everything he teaches is on point bro, he taught me dart lang forever appreciated Andrea
@albertgeorge1619
@albertgeorge1619 3 жыл бұрын
The most simplest and easily to understand definition of Flutter Provider you would ever find over internet. Trust me I searched for a long time. Now I understood it. Thanks to Andrea for taking his time to explain it at as simplest as possible.
@lucy-lh1py
@lucy-lh1py 3 жыл бұрын
I have been confuse about state management in Flutter for so long. now, it's clear thank you so much
@anandgupta8529
@anandgupta8529 3 жыл бұрын
a great teacher has two qualities- knows the concept well and explains the concept well. You have mastery over these two skills. Love your tutorial. Thank you
@quotesworld203
@quotesworld203 Жыл бұрын
I seen many of videos about notifier and consumer but I 😕 confused , after watching this video I am clear. Thank you soo much ❤️👍. You are the best teacher. ✅️
@tak68tak
@tak68tak 4 жыл бұрын
The best tutorial on Provider I've watched!
@shakibuzzaman8931
@shakibuzzaman8931 4 жыл бұрын
Outstanding Explanation! Diagrams can make learning so much easy. Best tutorial on provider.
@eliteelitebob
@eliteelitebob 4 жыл бұрын
Excellent tutorial
@josecoverlessons
@josecoverlessons 4 жыл бұрын
you are an excellent teacher and content creator
@ckybat
@ckybat 4 жыл бұрын
The simplicity of how you explain is excellent. Thank you very much for the time spent and how you make it easy to understand.
@sergdigital7437
@sergdigital7437 4 жыл бұрын
Brilliant explanation. Even the reply's on the comments are formidably accurate and well intended. I've never regretted subscribing to your channel.
@daviidon
@daviidon 4 жыл бұрын
Thanks for this presentation, I was having a hard time wrapping my head around provider but you make it seems so simple and showed us multiple ways of doing the same thing...thanks again
@vital-piker
@vital-piker 2 жыл бұрын
Thanks for the video! You are a great teacher! :) Explanation is clear and sophisticated!
@harrymitchell5853
@harrymitchell5853 4 жыл бұрын
Thanks Andrea!! Now I have a basic understanding of Provider for state management. You did a great job of explaining how it works.
@Asdfpt4dp
@Asdfpt4dp 2 жыл бұрын
I love the way you explained this. Helped me understand flutter so much better. Thanks!!
@_torgeek9108
@_torgeek9108 3 жыл бұрын
This is the first video that I have came across that has helped me understand the concept and how to implement it step-by-step. Thanks for the video @Code With Andrea
@SergioArroyoSailing
@SergioArroyoSailing 3 жыл бұрын
fantastic tutorial! I like the way you attack the Provider concept! One of the series on Provider I have seen so far :)
@agoodmansaid
@agoodmansaid 4 жыл бұрын
God bless you man, this is the easiest to understand provider tutorial on KZbin in my opinion. Subscribing 👏🏽
@Anom21
@Anom21 2 жыл бұрын
Hey man just wanted to say...I've looked at quite a lot of tutorials on providers...many of which shows how to code the provider and consumers etc. But this video is the best video I've ever seen on provider. It was very simple to follow and I learned a lot about providers that didn't know before. Thanks man!!
@witsislide
@witsislide 3 жыл бұрын
Thanks for the tuts, especially the diagrams, it helps to illustrate the package and the concept more easier to understand.
@SajbSky
@SajbSky 2 жыл бұрын
Thank you, very well explained...Much appreciated. I listened to others tutorial and this by far has been the easiest to follow and understanding. Keep up the good work :)
@M.BilalAhmad
@M.BilalAhmad 3 жыл бұрын
Finally found a good one on Providers. You definitely deserve a subscription!
@yanlay129
@yanlay129 3 жыл бұрын
Thanks man The Best Provider Tutorial
@skiplabacademy2570
@skiplabacademy2570 2 жыл бұрын
You've made my life a lot easier man. Thanks
@MrQooje2
@MrQooje2 4 жыл бұрын
Great detailed explanation! Simple and easy to follow. Thanks very much!
@fouadamine7329
@fouadamine7329 4 жыл бұрын
Congratulations, this is ths best explanation of provider, ever. I've been waiting for a such video, thank you sir. Please keep publishing videos on flutter app architecture.
@srhenalsr
@srhenalsr 4 жыл бұрын
This is an amazing tutorial! Great work man, thanks!
@spragucm
@spragucm 3 жыл бұрын
Excellent explanation. Thanks for the info.
@tonychong8181
@tonychong8181 4 жыл бұрын
Thank you so much for your Flutter videos! Extremely helpful!
@TahirHoxha
@TahirHoxha 3 жыл бұрын
The best Provider tutorial, it looks so easy now.
@whitemagehealing8126
@whitemagehealing8126 2 жыл бұрын
I love your diagram explanation!
@emadfathy1767
@emadfathy1767 3 жыл бұрын
Good guide Andrea, thank you.
@MuhammadAbid-lp6lg
@MuhammadAbid-lp6lg 4 жыл бұрын
You are awesome. Simple and straightforward explanation. Thank you sir.
@yamatatsu5776
@yamatatsu5776 4 жыл бұрын
This is the best material !!! Thank you.
@ElDiosxxx
@ElDiosxxx 3 жыл бұрын
omg you explain so well! thanks a lot!
@LearnFlutterCode
@LearnFlutterCode 3 жыл бұрын
Nicely explained on the value notifier
@prathameshacharya3457
@prathameshacharya3457 4 жыл бұрын
Beautifully explained!!
@AnthonyBOUQUET-Globule
@AnthonyBOUQUET-Globule 3 жыл бұрын
You just nailed it !
@SabirIslamKhan
@SabirIslamKhan 4 жыл бұрын
You are very good man.. I mean, the way you explain things. It's just awesome.. so simple to understand
@yuwenpixon
@yuwenpixon 4 жыл бұрын
This video tutorial is awesome. The explanations are very clear. Thanks to you. Actually I bought your course at Udemy about flutter
@vincemelia3534
@vincemelia3534 3 жыл бұрын
That was well explained - thanks.
@sergiofranklin8809
@sergiofranklin8809 4 жыл бұрын
Amazing tutorial
@letsdoeverythinginoneweek9398
@letsdoeverythinginoneweek9398 4 жыл бұрын
your explanation is great i watched many tuts but finally i understad it by watching ur video ..at last thank you for making this video
@sabinjose
@sabinjose 4 жыл бұрын
Excellent tutorial!
@lixiang3631
@lixiang3631 3 жыл бұрын
so greate video about provider !! thank you so much!!!
@user-jm2gu4zb7c
@user-jm2gu4zb7c 3 жыл бұрын
Very good video! Thanks
@lindermannla
@lindermannla 4 жыл бұрын
Greate tutorial! thnxz Andrea!
@Jdbluesky
@Jdbluesky 4 жыл бұрын
Wowwww, great tutorial!!! Thanks!!!
@djraven68
@djraven68 4 жыл бұрын
Great Tutorial :)
@ofeko1997
@ofeko1997 4 жыл бұрын
Your awsome! great tutorials!
@laujimmy8635
@laujimmy8635 4 жыл бұрын
Great tutorial
@mohammaduzair608
@mohammaduzair608 4 жыл бұрын
Thanks this has cleared all my doubts!
@hongweiwu9269
@hongweiwu9269 4 жыл бұрын
Best tutorial !!!
@techniker8745
@techniker8745 2 жыл бұрын
thanks very good explanation specially the diagrams very well done
@dicasdoanthony
@dicasdoanthony 4 жыл бұрын
Great explanation!
@askmrmoses
@askmrmoses 2 жыл бұрын
Very helpful!
@abderrazzakoxa-4149
@abderrazzakoxa-4149 4 жыл бұрын
Thank you Bro Good video ♥️
@krzysztofk.8842
@krzysztofk.8842 4 жыл бұрын
Duude.. you just saved me hours... I forgot to `notifyListeners` on one method in my Counter. Cheer mate. Liking a LOT!
@harry356
@harry356 Жыл бұрын
Very usefull, thanks!
@dhruvkelawala960
@dhruvkelawala960 4 жыл бұрын
Nice content 🤘
@fadhilkemal7367
@fadhilkemal7367 4 жыл бұрын
Amazing explanation
@45632476
@45632476 4 жыл бұрын
You're good! Please, continue.
@imed-boumalek
@imed-boumalek 3 жыл бұрын
excellent!!!!
@dimitrispaxinos2294
@dimitrispaxinos2294 3 жыл бұрын
Very nicely presented! Thank you Andrea for providing so much value. I also bought your Covid App Udemy course which has been ver helpful as well.
@armagan_gok
@armagan_gok 2 жыл бұрын
thanks a lot man you know how to teach
@abdelghafourabou-kacem9230
@abdelghafourabou-kacem9230 4 жыл бұрын
This is the best video on provider on youtube, hands down! Question: can i use this for an e comerce app to add items and remove them from a shopping cart ?
@ebrahimkassem8939
@ebrahimkassem8939 3 жыл бұрын
Woow.. Thank you sooo much
@SublustrisRU
@SublustrisRU 4 жыл бұрын
Отлично! Это один из лучших уроков на тему Provider. Единственно, прошу - поставьте popfilter на микрофон, звук станет лучше.
@zaidz6263
@zaidz6263 3 жыл бұрын
Thank you
@a989857
@a989857 4 жыл бұрын
It's very clearly to introduce "provider" by demonstrating simple sample
@look_rio
@look_rio 4 жыл бұрын
Thank you!!!!
@nidalbakir4720
@nidalbakir4720 4 жыл бұрын
thanks a lot
@sameerkashyap4620
@sameerkashyap4620 4 жыл бұрын
This was great! Hoping for a more in depth explanation of provider.
@CodeWithAndrea
@CodeWithAndrea 4 жыл бұрын
Coming next Monday.
@ankitgupta-iz3sc
@ankitgupta-iz3sc 4 жыл бұрын
Thanks!!!!!
@crazieeez
@crazieeez 4 жыл бұрын
Since provider version 3.2.0 , the builder for ChangeNotifierProvider is deprecated use create instead.
@G4MR1
@G4MR1 4 жыл бұрын
You made me understand Consumer better and ProviderNotifier seems useful, but currently I don't have a use case for it atm lol
@vinusubhash9106
@vinusubhash9106 2 жыл бұрын
Thanks
@suztomo
@suztomo 4 жыл бұрын
Thank you. I didn’t know “the widget identified by context” is used for listen: true.
@yixinli2161
@yixinli2161 4 жыл бұрын
nice thanks
@CodingwithDay
@CodingwithDay 3 жыл бұрын
Geat explanation! Thank you. Can you tell me the plugin that's been used here to show the error/problem on the screen as you type, please?
@b.u.s.y.b.e.e.
@b.u.s.y.b.e.e. 3 жыл бұрын
Thanks Andrea it was straight forward.. but I wanna ask what the builder method under ChangeNotifierProvider class is used for
@JobaerArman
@JobaerArman 3 жыл бұрын
Very useful & easy to understand tutorial. Though I have a question about your VSCode setup. How does the error display inline?? Which extension is it?
@mwont
@mwont 3 жыл бұрын
Any chance for the refreshed course? Many thinks shown here are already deprecated or not recommended any more.
@hieu4987
@hieu4987 4 жыл бұрын
Tell me something that better than this tutorial. Thank you so much
@findsarfaraz
@findsarfaraz 3 жыл бұрын
super...
@hoandovan1vti.d291
@hoandovan1vti.d291 3 жыл бұрын
Thanks for your tutorial! We'll wrap `ChangeNotifierProvider` outside when we create a new, ex: new `HomePage` in main file. Is this the best practice ?
@kirill4531
@kirill4531 4 жыл бұрын
Good one. Looking forward for an example with passing Provider to new screens (routing)
@CodeWithAndrea
@CodeWithAndrea 4 жыл бұрын
This is planned for one of the upcoming videos.
@kirill4531
@kirill4531 4 жыл бұрын
@@CodeWithAndrea awesome!
@SunilparajuliKenshin
@SunilparajuliKenshin 3 жыл бұрын
Hi Andrea, thanks for concise and easy tutorial , i like to ask for stateless widget, if i call my api using provider , i need to automatic call the methods (like fetchdata) once when the page is loaded so that widget rebuilds itself. By adding button it's okay but what i need it is automatically call the method.
@yanqingjing8582
@yanqingjing8582 3 жыл бұрын
what's the extension you are using for the quick widget add in?
@rikyriky966
@rikyriky966 4 жыл бұрын
Hi Andrea!! I’d like to thank you for this one. I hope you share an extended video about provider. I can get the concepts and I’ve using provider since it first came out. However, I really don’t feel confident about state management and structure yet. A question: Is it a good practice to wrap the root of the app widget with MultiProvider? This way I can expose every provider to the whole tree. By using the “listen: false” trick, it’s possible to prevent heavy and unnecessary rebuilds of irrelevant widgets. What do you recommend? Thank you!
@CodeWithAndrea
@CodeWithAndrea 4 жыл бұрын
Yes, you can wrap the root widget with MultiProvider. I often do this to add providers for all the app services (authentication, database etc). And using "listen: false" helps reducing rebuilds as you mentioned.
@icalculi
@icalculi 4 жыл бұрын
is it possible to create a form widget along with GlobalKey on a STATELESS widget?
@omkary.1510
@omkary.1510 3 жыл бұрын
Nicee
@themindstorm9947
@themindstorm9947 4 жыл бұрын
How do I pass a value to increment? How should I change to code if I want the onPressed to be something like counter.increment(5) ? Thanks!
@bilalsimsek7306
@bilalsimsek7306 4 жыл бұрын
As a perspective of this tutorial, I see Provider is looks like ValueListenableBuilder widget. How I use it in my project that I have a global class and ValueNotifiers as arguments of this class. and anywhere I need to update or listen this notifiers I only assign as Global().valuenotifier. I wonder what is advantage of using Provider instead of ValueListenables and valuenotifiers?
@theepicguy6575
@theepicguy6575 2 жыл бұрын
Im pretty late, but is there a way to simply run a set state when there is a change, rather than using a consumer, because I dont want to rebuild my google maps but i need to update the markers
@benmarcus2577
@benmarcus2577 4 жыл бұрын
thank you so much but why do we need so many builds?
Advanced Provider Tutorial - Part 1: Project Setup & Authentication Flow
13:43
Flutter State Management with Riverpod: The Essential Guide
28:38
Andrea Bizzotto
Рет қаралды 26 М.
Always be more smart #shorts
00:32
Jin and Hattie
Рет қаралды 49 МЛН
Я нашел кто меня пранкует!
00:51
Аришнев
Рет қаралды 4,3 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 25 МЛН
Top 16 Dart Tips and Tricks Every Flutter Developer Should Know
11:44
Andrea Bizzotto
Рет қаралды 59 М.
Flutter State Management - The Grand Tour
14:07
Fireship
Рет қаралды 237 М.
State Management Like A Pro - Flutter Riverpod
10:30
Robert Brunhage
Рет қаралды 75 М.
Flutter Provider: Introduction
9:55
Andrea Bizzotto
Рет қаралды 93 М.
Mastering React Context: Do you NEED a state manager?
37:26
Jack Herrington
Рет қаралды 97 М.
How to build any kind of app in Flutter (and overcome Tutorial Hell)
9:42
Flutter Provider Package In Depth - Change Notifier Provider
49:53
Top 12 Flutter Tips & Tricks
9:32
Fireship
Рет қаралды 266 М.
Choose a phone for your mom
0:20
ChooseGift
Рет қаралды 6 МЛН
⚡️Супер БЫСТРАЯ Зарядка | Проверка
1:00
Samsung Galaxy Unpacked July 2024: Official Replay
1:8:53
Samsung
Рет қаралды 23 МЛН
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 1,7 МЛН
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,9 МЛН