Flutter Basics: Updating The UI

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.ค. 2024
  • What are the fundamental ways of updating the UI? And how come the UI is not updating unless I run a Hot Reload? Fear not we will look into both of these and you will get a solid understanding of it 👏
    Course to build a production-ready app 👉 robertbrunhage.com/course
    Full writeup: robertbrunhage.com
    👉 Have additional questions, join Discord: / discord
    Want to support me?
    ♥ Patreon: / robertbrunhage
    ♥ BuyMeACoffee: buymeacoffee.com/robertbrunhage
    ♥ Paypal: paypal.me/robertbrunhage
    ····················································································
    You can find me on:
    ● Website: robertbrunhage.com
    ● Twitter: / robertbrunhage
    ● Discord: / discord
    ····················································································
    😎 Subscribe: bit.ly/2SUyRhx
    00:00 Overview
    00:31 SetState
    02:36 ValueNotifier
    05:26 ChangeNotifier + Provider

ความคิดเห็น • 74

  • @thisisbadpanda
    @thisisbadpanda 3 ปีที่แล้ว +31

    This man is a gift to the flutter community ❤️

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +6

      You are a gift to my community 😎

    • @sunilm4719
      @sunilm4719 3 ปีที่แล้ว +1

      @@RobertBrunhage cool reply

  • @shripranav623
    @shripranav623 3 ปีที่แล้ว

    Wonderful lesson from you Mate

  • @tejasmd8143
    @tejasmd8143 3 ปีที่แล้ว +3

    Exactly what I needed! Thanks pal!

  • @budisetiawan2499
    @budisetiawan2499 3 ปีที่แล้ว

    I always confuse how to use the value notifer etc but you explained it in the most simple way thank you my friend

  • @donathmm3881
    @donathmm3881 3 ปีที่แล้ว +1

    Thank you

  • @RidzCreations
    @RidzCreations 3 ปีที่แล้ว

    I love ❤ your 👨‍🏫📓Tutorials

  • @sachinkumarrajput5450
    @sachinkumarrajput5450 3 ปีที่แล้ว +1

    You are awesome bro before I think provider is too hard but after watching your video it's too easy😎😀 thanks brother.

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      Awesome, glad you found it helpful!

  • @hi-s
    @hi-s 3 ปีที่แล้ว

    Awesome I lock myself with setstate all time 🙂
    Thanks

  • @sunilk9760
    @sunilk9760 3 ปีที่แล้ว

    Please Tell us about FutureProvider.value

  • @francescotagliavento8081
    @francescotagliavento8081 3 ปีที่แล้ว

    which one is the best to use?

  • @nicolasbukowski6369
    @nicolasbukowski6369 3 ปีที่แล้ว

    Hello. I want to use a bottomnavigation bar. Depending on the chosen navigation menu there are different tabs displayed in the tabbar of the appbar. Unfortunately the tabbarview of the body doesnt update within the setstate. Do you know how to fix the problem?

  • @sachinkumarrajput5450
    @sachinkumarrajput5450 3 ปีที่แล้ว

    Setstate or valuenotifier or provider which one is better for e commerce application

  • @RandalLSchwartz
    @RandalLSchwartz 3 ปีที่แล้ว

    This is great. I've wanted a place to send people who don't understand how to wire up the view with model change notifications. Of course, I'd first reach for the RiverPod cluster, because every time I see Provider, it looks like a lot more boilerplate. But otherwise, great simple intro.

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      For sure, I almost always opt for Riverpod instead of Provider, the problematic part now is that the API changes a lot which would make that part of the video obsolete really fast....
      And thanks for the kind words Randal! 😊

    • @RandalLSchwartz
      @RandalLSchwartz 3 ปีที่แล้ว +1

      @@RobertBrunhage I hear Remi probably isn't going through with his considered UI changes, so we're basically accessing 1.0 for now, despite the pre-release numbering.

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      ​@@RandalLSchwartz Interesting! I will still probably wait until 1.0 to be sure 😊

  • @soulninjadev
    @soulninjadev 3 ปีที่แล้ว +1

    Hey i really like the syntax color and background of ur vscode, do u mind sharing ur theme, it looks like my IntelliJ but am not able to reproduce it in vscode

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      Have a whole video about my setup!
      th-cam.com/video/HhumfOSYFNc/w-d-xo.html

  • @garrrrrrrry6596
    @garrrrrrrry6596 3 ปีที่แล้ว +1

    Thanks for you video!
    But I guess the Selector method in Provider is better (Performance). Please correct me if I'm wrong.

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว

      In the case you want the children to only update when that specific variable of the ChangeNotifier is updated, then yes it is!
      I haven't personally had the need for it but it's a great way to optimize the app if you find that you need it 😊

  • @SamBellman
    @SamBellman 2 ปีที่แล้ว +1

    What is the advantage of using valueNotifiers and changeNotifier+provider over setState? They just seem to add a lot of extra complexity to do the same thing.

    • @RobertBrunhage
      @RobertBrunhage  2 ปีที่แล้ว

      Instead of me explaining it in a comment I think this post is worth a read!
      flutter.dev/docs/development/data-and-backend/state-mgmt/ephemeral-vs-app

  • @seanjanke5058
    @seanjanke5058 2 ปีที่แล้ว

    How can I update the UI without a TextField? For example I'm displaying the current time in my UI and want to update it automaticly.

  • @MattCantSpeakIt
    @MattCantSpeakIt 5 หลายเดือนก่อน

    Here is my question. I am running a process on a bunch of files. The process is executed by a service I made. How can I refresh my ui to show the progress? I don't think I can call a setstate from the service? The notifiers sound even more confusing?

  • @ericchua3492
    @ericchua3492 3 ปีที่แล้ว

    I am using Riverpod + StateNotifier for my app. Should I have mix of ChangeNotifier and StateNotifier? Or should I have only StateNotifier for my app? If there's a mixture, why should I use ChangeNotifier over StateNotifier?

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      Stay with Riverpod + StateNotifier if that works. StateNotifier is a reimplementation of ChangeNotifier but improved upon imo!

    • @ericchua3492
      @ericchua3492 3 ปีที่แล้ว

      @@RobertBrunhage Thanks

  • @meshkatshadik
    @meshkatshadik 3 ปีที่แล้ว

    You should talk about riverpod also, as it is not far from provider.

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      For sure but this case was more about showing ChangeNotifier not specifically Provider, it just made it easier to show!
      Can be used with Riverpod as well!

    • @meshkatshadik
      @meshkatshadik 3 ปีที่แล้ว

      @@RobertBrunhage that's great 🖤

  • @teh_raab
    @teh_raab 3 ปีที่แล้ว +1

    Is there any difference in doing context.read.name = vs. Provider.of(context, listen: false).name = ?

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      Nope :)

    • @teh_raab
      @teh_raab 3 ปีที่แล้ว +1

      @@RobertBrunhage Thanks :) I didn't think there was. Only just discovered the channel. Keep it up - the content is fantastic

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      @@teh_raab Thanks, glad you find it useful! 😊

  • @msharibahmed
    @msharibahmed 3 ปีที่แล้ว +2

    I have been using the provider state management from so long but I didn't that we can call the functions using context.read.name='Robert';
    I was always using Provider.of(context).name('Robert');

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      There is context.watch and context.read which is similar to having the listen property to true or false!

    • @msharibahmed
      @msharibahmed 3 ปีที่แล้ว +2

      @@RobertBrunhage Yes, I saw the Provider documentation after this video then I got to know about watch and read. I noticed that in flutter_bloc also, we use read and watch which makes me think if flutter_bloc is just a provider wrapper with some extra things.

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      It is using Provider 😊

  • @Ahmed-yr8wb
    @Ahmed-yr8wb 3 ปีที่แล้ว

    without you, it would've taken me months to understand flutter

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว

      I am just glad I was able to help, I have already been through those months 😂

  • @vladarskopin3314
    @vladarskopin3314 ปีที่แล้ว

    ValueNotifier seems like the best solution, or am I wrong?

  • @faisalmushtaq2287
    @faisalmushtaq2287 3 ปีที่แล้ว +2

    setstate is the worst, please help us with riverpod. Do a video with complete example like api calling, listview changing etc etc. Pleaseeeeeee!!!!!

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +1

      Not sure if it covers all that you want a video on, but I have a video with Riverpod that uses api calls, error handing etc!
      th-cam.com/video/3eOn4CtO5hg/w-d-xo.html

  • @mrverdant13
    @mrverdant13 3 ปีที่แล้ว

    Hey, man!!!
    Are you using the vim or neovim VSC extension?

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว

      As of now I am using the Vim extension, am thinking of trying out the neovim one as I also use neovim normally (not gotten it to be as smooth as vscode for Flutter yet though)

    • @mrverdant13
      @mrverdant13 3 ปีที่แล้ว +1

      @@RobertBrunhage yeah!
      The vim extension is pretty laggy on my setup
      That's why I turned to Neovim
      Both of them are pretty straightforward but that performance issue was critical
      PS: Quite nice and understandable video! Congrats!

  • @mayursinalkar606
    @mayursinalkar606 3 ปีที่แล้ว +1

    I thought integrating Firebase with Flutter would be easy.
    *_But damn am I bad at Authentication._*

    • @EagleZH23
      @EagleZH23 3 ปีที่แล้ว

      I feel you, it took me quite some time to set it up. But the rest is fairly easy though.

  • @tadaspetra
    @tadaspetra 3 ปีที่แล้ว +2

    Your app didn’t have my name in it 🤨

  • @angelsnmen
    @angelsnmen 3 ปีที่แล้ว +1

    FIFTH :)

  • @sambaotaku
    @sambaotaku 3 ปีที่แล้ว

    I think in this video you should have created that provider only for that view and not as a global provider.
    I made that mistake in my first app and end up with a lot of global providers.

  • @artofnessa
    @artofnessa 3 ปีที่แล้ว +3

    SECOND!

  • @asjadsidd
    @asjadsidd 3 ปีที่แล้ว +3

    First 😅

    • @RobertBrunhage
      @RobertBrunhage  3 ปีที่แล้ว +2

      You will not beat me next time, mark my word!

    • @asjadsidd
      @asjadsidd 3 ปีที่แล้ว

      @@RobertBrunhage lol

  • @faheemahmadofficial7701
    @faheemahmadofficial7701 3 ปีที่แล้ว +1

    dear brother I am expecting and I'm asking you many many times Please please please make a social media app just a basic one which shows a feed and some student or a person doing a post and the feed shows a like comment and share button UTC Please do that using SQL Server I really want to understand how that works but no one is teaching me how

    • @skorp5677
      @skorp5677 3 ปีที่แล้ว +1

      Well, for the buttons you find snippets/packages online if you don't want to do it yourself and a feed is just data from a database (or rather API, which has their own tutorial series' online and are not Robert's focus right now, because he just does frontend stuff), which should be really easy to bind into your app using the http package

    • @faheemahmadofficial7701
      @faheemahmadofficial7701 3 ปีที่แล้ว

      @@skorp5677 what about a ui for Social app basic

    • @skorp5677
      @skorp5677 3 ปีที่แล้ว

      @@faheemahmadofficial7701 I'm pretty sure, you know some social media layouts. If you want to build your own network, look at what's most important (UX might be an interesting topic for you) or if you are just looking for inspiration, there are lots of sites for designs only online

    • @skorp5677
      @skorp5677 3 ปีที่แล้ว

      After all, the UI is the part, that you have to come up with. The business asks just for a little creativity

    • @faheemahmad3957
      @faheemahmad3957 3 ปีที่แล้ว

      @@skorp5677 any good packages>