Flutter setState Example | Passing Data between Classes
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
Did the diagrams help? And did I use the word "Redundant" correctly? haha! Would love to hear your thoughts!
The diagram is awesome, it was very helpful, i really need visual aids like that while learning so thank you!
@@hope4ul Excellent!!!
@@LearnFlutterwithMe good stuff mate
@@Andreasonline3 thank you!
the diagram is awesome, it makes me understand what you are doing
The way you explained everything from the basic level is awesome.
true OG for typing all the code by hand
Really liked you video because of the simplicity of your explanation, as a beginner it's really helpful.
I like the way you are teaching, short and brief to the point. Easy to understand. Thank you very much.
Your videos are greatly detailed. Love the way you explain thoroughly.
You voice takes away half the stress I built through watching videos of other flutter related channels.
What a nice thing to say! Thanks!
Don't normally comment but want to help your ranking in the yt algo. Thanks for the great tutorial!
very good example for callback, thanks
Thank you for the great lesson. Clear and simple but very effective!
thank you! and thanks for watching!
Excellent Teacher!!!
Great tutorial. Very clear explanation and on point. Also your diagram is a big help to understand what's happening.
Excellent Tutorial! 5 Star!
amazing. Great way of expression thanks
so clean. thanks a lot Mr.
Really good explanation. Thank you.
Great video! Thanks a lot!!!
I watched and he never used autocomplete. What a genius!
exactly what i wanted thankyou
best explanation for callback functions
Superb....Thank you very much 🤗👌
Very Useful ❤
thank you for the video.
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.
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!
I like your videos a lot, thanks for your time....
Thank you bro!
Thank you!!
Thank for video,you one of best in explanation who i saw!
Glad it was helpful!
Great. Thank you for the video.
You're welcome!
thank you very clear and to the point
thanks for watching!
This video was so amazing...Thanks a lot...I'm from Brazil!!!!
Nice to "meet" you, thank you and you're welcome!
Wow, very knowledgeable tutor, this video is just perfect, many thanks.
Thank you so much! Thanks for watching!
you are my hero
very good videos :)
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 )
I'll see what I can do! Thanks!
very good
Thanks!
this diagram teachin damn dude wp..
How we use inbuilt function like list.remove inside setstate method..??
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
Hi, is there a way to pass multiple data to a stateful class?
here, in this exercise... i can call or declare Function with nullSafety...?
how to call future me4thod of stateful widget in another stateful class without using static before the method?
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 :).
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.
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!
Wich plugin do you use to get the widget-tree visualized as you type along?
It's unfortunately not a plugin, I create the graphics and add them when editing the videos. but it would be a cool one!
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 :\
Do you have a flutter series?
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!
@@LearnFlutterwithMe thanks I have subscribed your channel I'm waiting your notification
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.
Yeah I did it that way on purpose. It’s an instructional video. Thanks for watching!