Flutter setState Example | Passing Data between Classes

Поділитися
Вставка
  • Опубліковано 30 лип 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

КОМЕНТАРІ • 71

  • @LearnFlutterwithMe
    @LearnFlutterwithMe  3 роки тому +27

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

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

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

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

      @@hope4ul Excellent!!!

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

      @@LearnFlutterwithMe good stuff mate

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

      @@Andreasonline3 thank you!

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

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

  • @animetaste4197
    @animetaste4197 Рік тому

    true OG for typing all the code by hand

  • @muhammadali4653
    @muhammadali4653 Рік тому +1

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

  • @lostapple4039
    @lostapple4039 Рік тому

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

  • @Mahanmarwat
    @Mahanmarwat 2 роки тому +2

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

  • @muhammadali4653
    @muhammadali4653 Рік тому +1

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

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

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

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

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

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

    very good example for callback, thanks

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

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

  • @Tom-en9tc
    @Tom-en9tc 2 роки тому +1

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

  • @gusinthecloud
    @gusinthecloud Рік тому

    Excellent Teacher!!!

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

    Really good explanation. Thank you.

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

    exactly what i wanted thankyou
    best explanation for callback functions

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

    Excellent Tutorial! 5 Star!

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

    so clean. thanks a lot Mr.

  • @Mujhaid-Muslim
    @Mujhaid-Muslim Рік тому

    amazing. Great way of expression thanks

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

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

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

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

  • @klent3284
    @klent3284 2 роки тому +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  2 роки тому

      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!

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

    Great video! Thanks a lot!!!

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

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

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

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

  • @mayurasandakalumsellapperu6778

    Superb....Thank you very much 🤗👌

  • @HalfTime-gx1ui
    @HalfTime-gx1ui 3 місяці тому

    Very Useful ❤

  • @program353
    @program353 Рік тому

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

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

    thank you for the video.

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

    Thank you!!

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

    thank you very clear and to the point

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

    Thank you bro!

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

    Great. Thank you for the video.

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

    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 )

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

    you are my hero

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

    very good videos :)

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

    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

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

    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 3 роки тому +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  3 роки тому

      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!

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

    very good

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

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

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

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

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

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

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

    this diagram teachin damn dude wp..

  • @acornerofherheart-jr9pl
    @acornerofherheart-jr9pl 2 місяці тому

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

  • @noblenetdk
    @noblenetdk Рік тому

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

    • @LearnFlutterwithMe
      @LearnFlutterwithMe  Рік тому +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 6 місяців тому

    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 3 роки тому

    Do you have a flutter series?

    • @LearnFlutterwithMe
      @LearnFlutterwithMe  3 роки тому +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 3 роки тому

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

  • @corriedebeer799
    @corriedebeer799 8 місяців тому

    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 8 місяців тому

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