Flutter Provider - Advanced Firebase Data Management

Поділитися
Вставка

КОМЕНТАРІ • 162

  • @vtitsboti9815
    @vtitsboti9815 3 роки тому +143

    Can you pretty please make an updated version of this video? :)

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

      Yes, it's unclear how to setup the StreamProvider now :( It requires a value and an initial data but what do we put in initial data?

    • @NickFehlinger
      @NickFehlinger Рік тому +2

      @@samuelnihoul3159 You can put null in the initial data if there isn't cached data you want to load on init. Especially for authentication you want it to return null unless there is a logged in user.

  • @degonar3528
    @degonar3528 2 роки тому +3

    This way of teaching (presenting a problem and solution) about something like a third-party package is SO good. I hate it when tutorials just throw stuff and say "use it" and don't explain why can't I just use built-in stuff, which is often much easier to understand as a beginner. Thank you!

  • @iamfirdous
    @iamfirdous 3 роки тому +4

    Please make an updated version of this video.
    BTW, I love all your videos, they are crisp and clear, and you are always straight to the point.

  • @ManOnTheMoon2131
    @ManOnTheMoon2131 3 роки тому +21

    This was a great tutorial! Given its success, I think you should definitely come out with an updated version! Almost everything is outdated and/or deprecated.

  • @philippdice9483
    @philippdice9483 4 роки тому +1

    Thank you so much! You have such a nice way to write clean code eventhough some things getting quite complex!
    You helped me alot and I was able to save a lot of boiler plate code!

  • @JohnEGledhill
    @JohnEGledhill 5 років тому +35

    Excellent timing with suggesting Provider ... since at Google IO 2019 that is what was recommended. You got skillz.

    • @TwistedDestroyer99
      @TwistedDestroyer99 4 роки тому +3

      Does provider work with BLOC, or is that an alternative approach?

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

      @@TwistedDestroyer99 good question, anyone has answers?

  • @luisponce3580
    @luisponce3580 4 роки тому +1

    Im in the 7:07 minute mark and i stopped the video just to say that this video is very awesome!! I didnt know that there was the spread operator, good stuff!! Amazing video so far

  • @seunghwanjeong5348
    @seunghwanjeong5348 5 років тому

    so amazing !! this is what I was waiting for thank you !! :)

  • @blessingchelinje9317
    @blessingchelinje9317 5 років тому +1

    So far the best tutorial to learn the provider. 1000Likes from me

  • @joshuanovak919
    @joshuanovak919 5 років тому +13

    "Beer. Temporary solution." - If i wasn't already subscribed that would make me subscribe right there lol

  • @motta021
    @motta021 5 років тому

    Thank you Jeff. I love your videos.

  • @SilasSWF
    @SilasSWF 5 років тому

    Excellent tutorial. Thank you!

  • @ssokurenko
    @ssokurenko 5 років тому +32

    Top quality content! thanks Jeff

    • @Fireship
      @Fireship  5 років тому

      Thank you Sergey

    • @ShashankMSuresh
      @ShashankMSuresh 4 роки тому

      Ma name a jeff! 🤣🤣🤣 #22jumpstreet

  • @akhan2501
    @akhan2501 4 роки тому

    I promise to buy the advance course, as the basic intros have helped me land jobs in flutter

  • @JayPerf
    @JayPerf 5 років тому +2

    holy crap this is a good one hahah you are the best Firebase resource on the web dude, and the flutter stuff is also the best out there

    • @Fireship
      @Fireship  5 років тому +1

      Thank you Jason!

    • @JayPerf
      @JayPerf 5 років тому +1

      @@Fireship Seriously, I was about to head down the nested widget stream road you talk about, and this video was a revelation for solving that issue. I worked through your Firestore/Angular series before discovering your stuff on Flutter and started to try to teach myself that, and this is by *far* the most comprehensive "advanced concepts" channel out there

  • @crossmetz1372
    @crossmetz1372 5 років тому

    I was just watching google I/O about provider and boom , you post this

  • @storylineteam
    @storylineteam 4 роки тому

    As a game development company, trying to get to the app dev zone for our clients, we find your channel great! Coming from a .Net background angdbeing a small company, we decided to use Dart and flutter, mainly for the great merging of Composition ant OOP. ..
    Please Conceder on doing a video about end 2 end encryption on firestore data, as this is the most important not covered topic out there... and apis like Virgil are too expensive for small companies and individual devs and using user password as a encryption key prevents the data to persiston password changes.
    Here in Europe, with new personal data laws, firestore is useless without the ability to encrypt data.
    Continue your great job!All the best from Greece!

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

    I love the last tip!!

  • @basheeral-momani2032
    @basheeral-momani2032 2 роки тому

    That's awesome thanks for sharing this part,

  • @fawazjoseph878
    @fawazjoseph878 4 роки тому

    Thank you for this video.
    It really helped me solved a big problem with my app

    • @Fireship
      @Fireship  4 роки тому +1

      Glad to hear that, provider solved many of my problems

  • @braindongle
    @braindongle 4 роки тому

    This knowledge share is pretty incredible. Getting started with Flutter is easy, but the "ok, I'm going to build a real app" part is still evolving to say the least. Choosing a state mgt and dependency injection solution is coming along (Thank you Remi Rousselet!). But how does one approach client-server communication in a real-world app that uses Firebase? Where is your source of truth for the data model? Where do you keep global state? ...and on and on. So many questions. Great answers here.

  • @Anstroy95
    @Anstroy95 4 роки тому

    Thanks a lot for the explanation, I want to be like you one day 💪

  • @newtonmunene
    @newtonmunene 5 років тому +11

    Wow, that factory Class.fromMap trick is totally awesome. I can't believe I've been struggling to create classes from maps All this time

    • @oztech
      @oztech 5 років тому

      I know we need this, but is there any way we can automatically deserialize from map to object?

  • @mawulijo
    @mawulijo 5 років тому +5

    The gif in the intro keeps distracting me. hahahahahaha. Now I can write less code for the same results. Very grateful Sir Jeff.

  • @drdDavi
    @drdDavi 5 років тому +2

    You are a fast talker and alway paste the code instead of typing. But your videos are absolutely informative and clear! This one was especially helpful to me! Keep up the good work man! Flutter && VueJS && Firebase all the way.

    • @leofonseca8144
      @leofonseca8144 5 років тому +1

      you can slow down the video to 25%. then watch it at 50% then at full speed. typing wastes time. Im just grateful his english is crystal clear, as the subject matter already demands your full attention. a lot of other fluffer channels fail miserably at this.

  • @danchatka8613
    @danchatka8613 4 роки тому +3

    Thank you for your great tutorials.
    It would be nice if you had a simpler introduction to Flutter Provider. It would be very similar to this tutorial, except:
    a) Don't base the tutorial needing a server-side resources. Maybe reading a local config file would be a simpler way to get params that are needed by different widgets in the app;
    b) skip discussion of other Flutter state management techniques or their history. That topic is better suited for an update to your Flutter state management Grand Tour tutorial.

  • @user-fh4xo2pc2d
    @user-fh4xo2pc2d 5 років тому +26

    Would you cover using other backend like node.js with flutter? Thank you for all the flutter tutorial. I'm buying your course!

    • @Fireship
      @Fireship  5 років тому +24

      Yes I would consider that. Dart has a good HTTP package and I've also been thinking about a graphql vid for other backends.

    • @aislanarislou
      @aislanarislou 5 років тому +4

      @@Fireship Graphql would be awesome!

    • @raul286162
      @raul286162 5 років тому

      Node plz also would like golang

  • @derrickawuah9477
    @derrickawuah9477 5 років тому +3

    Great video Jeff! I definitely like this better than Bloc for my use cases. Do you plan on covering Flutter testing in the future?

    • @Fireship
      @Fireship  5 років тому +1

      Yes, testing in one my video list, but no exact timeline yet...

  • @RobertBrunhage
    @RobertBrunhage 5 років тому +5

    Great video, will have to check out Provider soon 🤔

    • @Fireship
      @Fireship  5 років тому +3

      It's really underrated, I've been enjoying it!

    • @RobertBrunhage
      @RobertBrunhage 5 років тому +4

      @@Fireship Using BLoC right now so that I can call a function from the BLoC to update other UI when data is updated in Firestore. Is this something that is possible with Provider?
      Edit: Using provider now and replaced the way I provide my BLoCs. Really cleans up the code!

    • @AR4U303
      @AR4U303 4 роки тому

      @Robert Brunhage , what you mean? Using provider with bloc pattern??

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

      @@RobertBrunhage can you please elaborate a bit?

  • @saifhakeam8599
    @saifhakeam8599 5 років тому

    YOU SIR..... are a legend

  • @emmanuelogbewe2334
    @emmanuelogbewe2334 5 років тому

    Great vid!!

  • @jaydanu
    @jaydanu 5 років тому +3

    Hey can you share which VS Code Theme are you using? I can't seem to find the exact same one and I like the color scheme, it's easy on the eyes and the contrast is good.

  • @Blues_unicat
    @Blues_unicat 5 років тому

    You are hero of flutter-er

  • @Hell2Night
    @Hell2Night 5 років тому +3

    I learn about this package in the Pragmatic state management session of the Google IO. This is great, now, I don't see the point to use such things as BloC for state management. Provider make it easier, and reduce boilerplate.

    • @Fireship
      @Fireship  5 років тому

      That was a good talk. I like the flexibility of Provider and you can even use it to roll out your own Bloc-style solutions.

  • @lyseihakh
    @lyseihakh 4 роки тому

    Wow so good content. thank you

  • @lukaszs9648
    @lukaszs9648 4 роки тому

    Love it!

  • @tirupatirao7521
    @tirupatirao7521 4 роки тому

    Peak Video tutorial for flutter

  • @anderslovbrand
    @anderslovbrand 4 роки тому

    I enjoy and use many of your patterns!
    However when abstracting with Collection , how can I pass arguments that makes me apply where- or orderBy-rules?

  • @fpsColton
    @fpsColton 4 роки тому

    When you setup your StreamProvider with the onAuthStateChanged, I notice that for a brief moment during the app's startup, that the value provided is null. How can you implement a loading page to appear when you only have null or not null to test with in the child widgets?

  • @eduardogthiesen
    @eduardogthiesen 4 роки тому +1

    Great video! I was wondering though, if, let's say I have 1000 documents in a collection, for each time I call Provider.of in a new screen Firebase will count it as 1000 reads?

  • @JochemToolenaar
    @JochemToolenaar 5 років тому

    Awesomeness!

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

    please make an updated version...... A must watch for flutter developers

  • @SafdarAliShah_TimeTraveler
    @SafdarAliShah_TimeTraveler 5 років тому

    i will be the luckiest guy to work with you on flutter and i m Sure that will be everything to learn everything...

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

    que buena chamba compañero. good

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

    Great video. Quick question, is it possible to run calculations using a StreamBuilder as a class and then access the output of those calculations as Provider? Rather than run the repeat calculations at each required part of the app.

  • @BeastinlosersHD
    @BeastinlosersHD 4 роки тому +1

    When putting your StreamBuilders inside of providers: [] in MyApp, change it from
    stuff(lazy to type it).value(stream: FirebaseAuth.instance.onAuthStateChange) to
    stuff(lazy to type it).value(value: FirebaseAuth.instance.onAuthStateChange)
    This is because when provider moved to v3 they broke a bunch of stuff from the previous version. You can look into it in more detail on their Github repo's readme

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

      you are a god, was trying to figure out what the deal was

  • @kiranjisac4745
    @kiranjisac4745 4 роки тому +1

    Hi What to do when stream provider is called on null when The. Collection is not created yet

  • @peekpt
    @peekpt 5 років тому

    I've been playing with provider, seems to be the next thing

  • @0x4ym4n
    @0x4ym4n 5 років тому

    Great!

  • @kameshvadivel9459
    @kameshvadivel9459 4 роки тому

    Sir,I am using grid view builder to load images from friestore, when I scroll down images are again loading, I also tried cached network image but it not worked,how to solve this problem?? Can you help me??

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

    can you explain the difference between the streamprovider and streamprovider.value constructors? its hard to find anywhere.

  • @rutayisirewilly1217
    @rutayisirewilly1217 4 роки тому +1

    Hello could you tell me if possible how to handle errors in stream provider. thnks

  • @storylineteam
    @storylineteam 4 роки тому

    I have a question about listening to firebase changes via streams... Is it possible this approach to be more expensive than implementing some time based or manual refresh method? Especially on apps with a large userbase? I mean, if a user remains for a long time to the same page that makes the dispose method useless..

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

    stream provider asks for 'initialData', when I hot restart, the child widgets take the 'initialData' instead of the most recent data from the stream. I want it to take the most recent data instead of the value given in InitialData. Anyone knows how I can do that?

  • @politicallynotcorrect2968
    @politicallynotcorrect2968 4 роки тому

    Can you talk about more in depth on all the providers options like providers stream ect...

  • @E-Hub_01
    @E-Hub_01 4 роки тому

    simple but implementation is very complex.

  • @antonivanov5751
    @antonivanov5751 5 років тому

    Thank you very much for your videos. Could you answer - what's the font in your VS Code that you use?

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

      I think it is "Fira Code".

  • @kevinbenhoff3560
    @kevinbenhoff3560 4 роки тому

    Would you say that StreamProvider is a resource expensive way to manage state as compare to say ChangeNotifierProvider? In your example you listen to a User stream which is cool because if anything is changed in Firestore it is immediately updated in the app. However, this seems to me like it would be a fairly resource intensive (battery, wifi, data xfer) way listening to the database for changes that may not really be all the frequent. Should StreamProvider with regards to data in Firestore be reserved for things that require instant updates (like notifications for example) while data that doesn't change too often be handled by ChangeNotifierProvider. Thoughts?

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

    How can i Provide 2 streams in the MultiProvider array with one dependent on the other?

  • @immathiasyde
    @immathiasyde 3 роки тому +2

    How can you use the Realtime Database instead of Firestore?

  • @parwandaha3091
    @parwandaha3091 4 роки тому

    I still cant make the connection between the user, superhero and weapons. where did the users come in the picture?

  • @muhammadchhota4463
    @muhammadchhota4463 5 років тому

    Is multi provider share data between multiple pages?

  • @chinmayagarnaik6458
    @chinmayagarnaik6458 4 роки тому

    Please can you make a video on how to retrieve double value or geo point from firebase

  • @YuppinYanni
    @YuppinYanni 5 років тому

    Are you coming out with a Flutter for beginners course soon or just the Flutter Firebase course for now?

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

    Hmm I just created some classes to feed the data from firebase firestore to my widgets

  • @aislanarislou
    @aislanarislou 5 років тому

    Hey @Fireship, Do you think Cloud Firebase is capable of replace an database architecture composed with some tables (I'm using Postgres) that have many-to-many relationships? Those relationships frequently have many-to-many between 3 tables.

    • @Fireship
      @Fireship  5 років тому

      It's probably possible, but might not be practical. Sometimes it's better to duplicate or partially migrate the data you want in Firebase. Every case is different.

  • @maximilianystalloyd6610
    @maximilianystalloyd6610 4 роки тому

    How can you update the data from a widget that uses Provider.of?

  • @jonathankumar2052
    @jonathankumar2052 5 років тому +2

    Can you update this or the blog post to v3 of provider, there are some subtle differences such as different parameter names and etc.

    • @ChristianJosephs
      @ChristianJosephs 5 років тому +1

      @fireship this is a real thing. The syntax changed with the update and the blogpost isn't up-to-date anymore. I think that can be fixed within 10min work?

    • @jonathankumar2052
      @jonathankumar2052 5 років тому

      @@ChristianJosephs agreed, its completely different, although the readme does guide you through the transition, it could be a bit confusing for flutter/dart beginners @fireship please try to fix this.

  • @oliverbytes
    @oliverbytes 4 роки тому +1

    What if the Firebase User changes it's display name suddenly.. will it be updated automatically by the Stream or you'll have to manually refresh the FirebaseUser?

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

      good question. did you figure out?

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

      @@Lensbreak yes I did :)

  • @happynewyearw
    @happynewyearw 5 років тому

    But isn’t provider still highly tied business logic with widget tree? For example, when we have to put widget in the child of Multiprovider? When the app scale up or we have to move widget and functionally around, there’s still a lot of refactoring to do, unless we put the multiprovider at the very top of the widget tree?

    • @Fireship
      @Fireship  5 років тому

      That is true, but you need some way to tell the framework where its data dependencies are located. I think Provider does this in a way the fits the ergonomics of Flutter well.

  • @quirky_hehe
    @quirky_hehe 5 років тому

    Is there an option to buy the flutter course alone without a subscription?

  • @edbienes
    @edbienes 5 років тому

    Please cover svelte and firestore :)

  • @carlospedroza7114
    @carlospedroza7114 5 років тому

    Awesome tips and tricks! Keep the good work! There is a new version of the library (now 3.0.0) at pub.dev/packages/provider, and Provider now throws if used with a Listenable or a Stream. We can disable it with Provider.debugCheckInvalidValueType = null;

  • @adebajooluwaseyi2124
    @adebajooluwaseyi2124 4 роки тому

    one year and still here

  • @RudeboyJackson
    @RudeboyJackson 5 років тому

    I'm trying to implement this, but getting the following error at this line:
    StreamProvider.value
    Error: "The class 'StreamProvider' doesn't have a constructor named 'value'."
    Could someone possibly explain what I'm doing wrong? Will really appreciate it!

    • @RudeboyJackson
      @RudeboyJackson 5 років тому

      Ah, had to update the Provider package

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

    can we have a vidoe for many-to-many relationships using this logic?? thanks

  • @oztech
    @oztech 5 років тому

    I refactored my code from using Redux to BlocProvider and now I need to refactor again with Provider :-) ha.. but the Provider seems better than my current solution,,, only if it scales well.

    • @oztech
      @oztech 5 років тому

      wait.. how do you change the value (state)?

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

    why we using the factory consturctor why not a simple function?

  • @jaigohil4963
    @jaigohil4963 5 років тому

    @Fireship can you make a video flutter app deployment both on ios and android? And other lisencing stuff that goes with it!

    • @Fireship
      @Fireship  5 років тому

      I may do that in the future, but I cover the deploy process in the full course for both google play and apple.

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

    please do this video again but with riverpod

  • @felixo9234
    @felixo9234 5 років тому

    Flutterfire 🦄

  • @VishalDesai711
    @VishalDesai711 5 років тому

    what is factory return type in SuperHero?

  • @ethanzhang8932
    @ethanzhang8932 5 років тому

    just curious what plugins are you using in the VS code editor, they are looks awesome, could you share the plugins?

    • @Fireship
      @Fireship  5 років тому +2

      I will make a video that reveals all this stuff very soon :)

  • @rajdave9862
    @rajdave9862 4 роки тому

    Please tell, from where you are learning all of these because I am not able to learn from docs. So please tell us your sources to learn?!

  • @RoughSubset
    @RoughSubset 5 років тому

    Hey Jeff, how do you get those emojies in your IDE and in Firestore?

    • @Fireship
      @Fireship  5 років тому +1

      They are actually just strings so you can simply copy/paste them emojipedia.org/

  • @ddean3732
    @ddean3732 4 роки тому

    Great vid.
    I have a question... Can I contact you directly?

  • @tarunblaze
    @tarunblaze 4 роки тому

    How do I Implement my isEmailVerified using provider

  • @Mohamedhassan-if8ww
    @Mohamedhassan-if8ww 5 років тому

    Can i ask you something . how does the WeaponList find the weapons weapons = Provider.of(context);
    and you didnt evil put that stream in the multi provider

    • @gmmkkgmmkk6168
      @gmmkkgmmkk6168 5 років тому

      I am confused also
      did you find solution?

    • @Mohamedhassan-if8ww
      @Mohamedhassan-if8ww 5 років тому

      @@gmmkkgmmkk6168 No just waiting for his answer maybe he can explain how the cycle goes or we are missing something

    • @gmmkkgmmkk6168
      @gmmkkgmmkk6168 5 років тому

      What is your email?

  • @doodies1234
    @doodies1234 5 років тому

    hey! any thoughts on fish redux?

  • @abhishekbutola8294
    @abhishekbutola8294 5 років тому

    What if streamHero returns null? I am getting error on model file. The methos '[ ]' was called on null

    • @abhishekbutola8294
      @abhishekbutola8294 5 років тому

      nvm figured it out

    • @abhishekbutola8294
      @abhishekbutola8294 5 років тому

      What i did was return the .forMap() with default values Map but the problem is that first I am getting the error screen showing null then its rerendering the default values instantly.

  • @pubgkillers4537
    @pubgkillers4537 4 роки тому

    The method 'map' was called on null.
    Receiver: null
    Tried calling: map(Closure: (Weapon) => Card)
    This is the error that i am getting when trying to use your tutorial. Please helpp.

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

    wow... it's interesting to see how dart has changed dramatically in last Frew years... Now it always Buggs me to add const modifier and null check...

  • @victornweze7230
    @victornweze7230 5 років тому +1

    boom

  • @willielassiter
    @willielassiter 4 роки тому

    In your "Flutter" playlist, videos 8, 9 and 10 look to all be the same: "Flutter Provider - Advanced Firebase Data Management". you might want to take a look at that and clean it up if i'm right... or not....

  • @giuliogolinelli6003
    @giuliogolinelli6003 5 років тому

    Jeff at 0:11 : Introducing video's content
    Italians: ua-cam.com/video/59L51yWUFiQ/v-deo.html

  • @flutterkhouse7498
    @flutterkhouse7498 5 років тому

    What's the intro song's name?

  • @TimeoutMegagameplays
    @TimeoutMegagameplays 5 років тому

    I still don't get all those state management providers, why not only use a StreamBuilder? You have to write lots more to code to achieve the same result with the other solutions.

    • @Fireship
      @Fireship  5 років тому +1

      Provider does not require extra boilerplate. It's actually less code than StreamBuilder (in fact, its syntactic sugar for it) because it manages the subscriptions for you, so you can treat the emitted value as if it were synchronous

    • @TimeoutMegagameplays
      @TimeoutMegagameplays 5 років тому

      ​ Fireship ​Oh I didn't catch that synchronous thing, that is actually pretty useful stuff.

  • @kotivideos7140
    @kotivideos7140 5 років тому

    what you prefer to use? provider or rxdart ?

    • @Fireship
      @Fireship  5 років тому +1

      They serve different purposes, I actually use provider in combination with RxDart. Rx is useful when you need specialized control flow over the stream itself.

  • @andreafeletto
    @andreafeletto 4 роки тому

    You never know the knowledge you will need in the future... For example I could have never thought than knowing the channel milleaccendini would have helped me with flutter development.

  • @Lensbreak
    @Lensbreak 3 роки тому +2

    BLOC or PROVIDER ? what is better in 2021?

    • @AbdulMunim-kx6np
      @AbdulMunim-kx6np 3 роки тому +1

      For me it's provider

    • @AbdulMunim-kx6np
      @AbdulMunim-kx6np 3 роки тому

      Because i only.know that not the bloc pattern

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

      Provider is definitely better and easier but a lot of recruiters are looking for developers with BLOC experience