Flutter setState Example | Passing Data between Classes

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • In this video I discuss passing data between Classes using setState, specifically passing variables back to the parent statefulWidget in a somewhat simple Flutter example.
    Chapters:
    0:00 Intro and initial setup
    1:42 Adding MaterialApp,Scaffold and AppBar
    3:35 Adding an ElevatedButton
    4:25 setState inside the same Class
    5:22 Testing with multiple ElevatedButtons in same Class
    6:14 replacing the ElevatedButtons with a Custom Button
    8:30 passing variables across Classes
    Video on Provider 5 and changeNotifier
    • Flutter Provider 5 cha...
    #flutter #learnflutter
    Instagram:
    learnflutterwithme
    Stuff I use for this channel (Affiliate Links)
    SanDisk 1TB SSD amzn.to/3j1U8py
    Elgato Cam Link 4K amzn.to/37EyqBK
    Logitech G600 Mouse amzn.to/36DYFYz
    Logitech G Pro Keyboard amzn.to/3saco38
    Macbook Pro M1 13" amzn.to/36GzbKc
    Neewer Mic Arm amzn.to/3z7RvIm
    Davinci Resolve amzn.to/3erEb9I
    Adobe Photoshop Elements amzn.to/3BkPKth

Komentáře • 71

  • @LearnFlutterwithMe
    @LearnFlutterwithMe  Před 3 lety +27

    Did the diagrams help? And did I use the word "Redundant" correctly? haha! Would love to hear your thoughts!

    • @hope4ul
      @hope4ul Před 3 lety +1

      The diagram is awesome, it was very helpful, i really need visual aids like that while learning so thank you!

    • @LearnFlutterwithMe
      @LearnFlutterwithMe  Před 3 lety

      @@hope4ul Excellent!!!

    • @Andreasonline3
      @Andreasonline3 Před 3 lety

      @@LearnFlutterwithMe good stuff mate

    • @LearnFlutterwithMe
      @LearnFlutterwithMe  Před 3 lety

      @@Andreasonline3 thank you!

    • @vtvvnha2230
      @vtvvnha2230 Před 2 lety

      the diagram is awesome, it makes me understand what you are doing

  • @muhammadali4653
    @muhammadali4653 Před rokem +1

    The way you explained everything from the basic level is awesome.

  • @animetaste4197
    @animetaste4197 Před rokem

    true OG for typing all the code by hand

  • @muhammadali4653
    @muhammadali4653 Před rokem +1

    Really liked you video because of the simplicity of your explanation, as a beginner it's really helpful.

  • @ngcheechuen8591
    @ngcheechuen8591 Před 2 lety

    I like the way you are teaching, short and brief to the point. Easy to understand. Thank you very much.

  • @Mahanmarwat
    @Mahanmarwat Před 2 lety +2

    Your videos are greatly detailed. Love the way you explain thoroughly.

  • @danieltrump9110
    @danieltrump9110 Před 2 lety

    You voice takes away half the stress I built through watching videos of other flutter related channels.

  • @lostapple4039
    @lostapple4039 Před rokem

    Don't normally comment but want to help your ranking in the yt algo. Thanks for the great tutorial!

  • @gideonmair7922
    @gideonmair7922 Před 2 lety

    very good example for callback, thanks

  • @Tom-en9tc
    @Tom-en9tc Před 2 lety +1

    Thank you for the great lesson. Clear and simple but very effective!

  • @gusinthecloud
    @gusinthecloud Před rokem

    Excellent Teacher!!!

  • @josephmelbaleyos9511
    @josephmelbaleyos9511 Před 2 lety

    Great tutorial. Very clear explanation and on point. Also your diagram is a big help to understand what's happening.

  • @joehilinski7008
    @joehilinski7008 Před rokem

    Excellent Tutorial! 5 Star!

  • @Mujhaid-Muslim
    @Mujhaid-Muslim Před rokem

    amazing. Great way of expression thanks

  • @saidaydn5159
    @saidaydn5159 Před 2 lety

    so clean. thanks a lot Mr.

  • @cjw6659
    @cjw6659 Před 2 lety

    Really good explanation. Thank you.

  • @claudiograsso
    @claudiograsso Před 2 lety

    Great video! Thanks a lot!!!

  • @yawsampenebuadu9918
    @yawsampenebuadu9918 Před 2 lety +1

    I watched and he never used autocomplete. What a genius!

  • @sydneygomes7180
    @sydneygomes7180 Před 2 lety

    exactly what i wanted thankyou
    best explanation for callback functions

  • @mayurasandakalumsellapperu6778

    Superb....Thank you very much 🤗👌

  • @HalfTime-gx1ui
    @HalfTime-gx1ui Před 3 měsíci

    Very Useful ❤

  • @lemonyth
    @lemonyth Před 3 lety

    thank you for the video.

  • @klent3284
    @klent3284 Před 2 lety +3

    Great tutorial. Finally a video that is simple and easy to understand. You are a great teacher. My only suggestion is to change the 'clicking' sound, it's too harsh and distracting.

    • @LearnFlutterwithMe
      @LearnFlutterwithMe  Před 2 lety

      Thank you! Yeah I don't use the sound effects as much as I used to, but I do still use them some and should probably use them more than I do haha! So I'll listen back to this video and make sure I get that corrected for the future. Appreciate the feedback!

  • @program353
    @program353 Před rokem

    I like your videos a lot, thanks for your time....

  • @earthrelated
    @earthrelated Před 2 lety

    Thank you bro!

  • @danieltolessa6962
    @danieltolessa6962 Před 3 lety

    Thank you!!

  • @granchik9852
    @granchik9852 Před 3 lety

    Thank for video,you one of best in explanation who i saw!

  • @ajudaprofessor
    @ajudaprofessor Před 3 lety

    Great. Thank you for the video.

  • @RabeeQiblawi
    @RabeeQiblawi Před 2 lety

    thank you very clear and to the point

  • @higorgustavobarbosadasilva9624

    This video was so amazing...Thanks a lot...I'm from Brazil!!!!

  • @djjavvystark5470
    @djjavvystark5470 Před 2 lety

    Wow, very knowledgeable tutor, this video is just perfect, many thanks.

  • @gh0zi0
    @gh0zi0 Před 2 lety

    you are my hero

  • @vtvvnha2230
    @vtvvnha2230 Před 2 lety

    very good videos :)

  • @eniolaadeniyi309
    @eniolaadeniyi309 Před 2 lety

    this is more explanatory. will like you to do a full course on Getx state management.
    once again you are indeed a genius (nothing like auto complete throughout the video )

  • @ramogly6942
    @ramogly6942 Před 3 lety

    very good

  • @thelastcat8406
    @thelastcat8406 Před 3 lety

    this diagram teachin damn dude wp..

  • @krishnacreation9211
    @krishnacreation9211 Před 2 lety

    How we use inbuilt function like list.remove inside setstate method..??

  • @uttamkumarsingh1172
    @uttamkumarsingh1172 Před 3 lety

    great video i like it way of teaching.
    if you want to grow more faster than other
    you should create video in one topic zero to end like topic like riverpod
    create clone code and more
    you should try once
    thank you

  • @wannurnafisahbintijunaidis7707

    Hi, is there a way to pass multiple data to a stateful class?

  • @francescofreddi4374
    @francescofreddi4374 Před 2 lety

    here, in this exercise... i can call or declare Function with nullSafety...?

  • @acornerofherheart-jr9pl
    @acornerofherheart-jr9pl Před měsícem

    how to call future me4thod of stateful widget in another stateful class without using static before the method?

  • @simsni5168
    @simsni5168 Před 3 lety

    Thank you! Very clear explanation. I have a question regarding forms. Is there any way we can differentiate textformfield and button, and put them in different classes, keeping the communication between them and validating the form when the button is pressed? thanks a lot.
    Also. regarding your videos. I really enjoy them. I think that the music in the background is very calming, and for me, atleast, it somehow makes things more clear. The diagram: I had to stop the video and glance at it to understand, but when I did stop the video, and looked at it, it all clicked :).

    • @simsni5168
      @simsni5168 Před 3 lety +1

      P.S I really do believe that you are gonna get more views eventually, dont stop the videos and have some patience, having seen many videos and not only flutter tutorial, i got to say that yours are one of the best.

    • @LearnFlutterwithMe
      @LearnFlutterwithMe  Před 3 lety

      Thank you so much, that's great to hear! I really appreciate it! So the short answer is yes that's doable... getting the elements into classes is straight forward, the validation is the question. Let me think it out and I'll get back to ya!

  • @noblenetdk
    @noblenetdk Před rokem

    Wich plugin do you use to get the widget-tree visualized as you type along?

    • @LearnFlutterwithMe
      @LearnFlutterwithMe  Před rokem +1

      It's unfortunately not a plugin, I create the graphics and add them when editing the videos. but it would be a cool one!

  • @djoeneh
    @djoeneh Před 6 měsíci

    hmm, i'm trying this with 3 classes: 1 class "textbar with the var", 2 class " the buton with the var = "newtext" , and the 3 class wrap 1class in column and stuff. this dont work on that :\

  • @abdallahhussein5997
    @abdallahhussein5997 Před 3 lety

    Do you have a flutter series?

    • @LearnFlutterwithMe
      @LearnFlutterwithMe  Před 3 lety +2

      Are you asking me if I have a Flutter course somewhere? Not yet but I hope to in the near future! I'll let you know if/when I do!

    • @abdallahhussein5997
      @abdallahhussein5997 Před 3 lety

      @@LearnFlutterwithMe thanks I have subscribed your channel I'm waiting your notification

  • @corriedebeer799
    @corriedebeer799 Před 8 měsíci

    jesus man you are typing way too much. VS Code snippets gives you all the code with a press of a button. Your coding is very inefficient.

    • @tocleora
      @tocleora Před 8 měsíci

      Yeah I did it that way on purpose. It’s an instructional video. Thanks for watching!