Тэги:
#purpose:_Educate #pr_pr:_Flutter #series:_Decoding_Flutter #type:_DevByte_(deck_cleanup_0-10min) #GDS:_Yes #developer_tutorials #Flutter #Flutter_tutorials #Flutter_developers #flutter_app_development #Flutter_course #how_Flutter_works #Flutter_best_practices #Decoding_Flutter #Google_developers #flutter_101 #get_started_with_flutter #flutter_apps #flutter_widgets #build_apps_with_flutter #flutter_developer #flutter_developers #Craig_LabenzКомментарии:
Super video. Great good practice.
ОтветитьI hope flutter / dart one day move to functioning programing, i hate classes so much boiler plate
ОтветитьYo me había preguntado eso. Gracias amigo
ОтветитьI never thought about performance and testability but I always preferred NewWidgets instead of helper methods as it looked more natural to do in platform like flutter.
ОтветитьThat's really nice
ОтветитьMinimizing dropped frames is nice but the real benefit is the power consumption. The vast majority of devices can run resource intensive apps effortlessly, but the power consumption is greatly affected. Making efficient apps is more for the battery life than for performance nowadays (although it's always good having faster apps as well)
ОтветитьThanks! These videos is really helpful!
I was in doubt about to separate the widgets (like Text('Hello');) in local variables, if it is also a bad idea... Another doubt is if for example I have a Widget with a lot of params, can I pass these params to another Widget using its instance? Like: WidgetWithALotParams(SomeChildWidget(parent: this)); (then the SomeChildWidget will have access to all WidgetWithALotParams params)
What about if you use a global state management package like GetX or state rebuilder? Doesn't that mean that only the reactive part of the widget tree is rebuilt on state change?
ОтветитьThis is a extrenely valuable information. Thanks
ОтветитьThanks! I’ve been approaching the limits of readability in my current project and the „refactor widgets“ todo has been getting more and more priority recently. Now I know what to look out for :)
ОтветитьI needed this
ОтветитьWhy not use stateful builder with the helper widget?
Ответитьhow about if we use getx?
ОтветитьBeen curious about this issue for a while now, you hit the nail on the head as always, thank you Google
ОтветитьGreat video. Thanks
ОтветитьIt is sad that const won't work with any localisation approach and most of the endpoint widgets in the widget tree brunches are Text.
ОтветитьGood recommendations.
ОтветитьIs there any scenario where helper methods would be a better choice than use a class?
ОтветитьGeez wish someone told me this 3 years ago! I started with dozens of helper functions, slowly started using seperate widgets so the dart file wasn’t 2000 lines long. Still have a lot of refactoring to do 😅
ОтветитьI really love the intro music!
can I have the full version? Hahaha
Well this is helpful and I started doing this but hit some limitations (Either in my understanding or with Flutter)
So I have a form that has a complex dropdown that I would rather seperate it.
I still want to have access to values inside that dropdown for when I submit.
With a helper function I have access to that variable and can read it when I'm ready to submit
With a seperate class I don't have that link.
Is there a way I can share this data?
So, using classes is better than using helper methods.
Ok, but is this a big difference?
If it is not, I would prefer to use helper methods in general for smaller sub pieces of UI.
Because using classes for these small things means you will have a huge amount of classes (all of which you have to try to name correctly), and a larger percentage of your codebase will be boiler plate.
That was just soo helpful! As a new flutter developer, I just can't underestimate the value of such and advice!
ОтветитьI also had thoughts about this topic. I started using separate classes for widgets but main problem I face with that is passing variables and callbacks are a bit challenging.
ОтветитьThanks
ОтветитьTried to apply this principle to create a countdown function but for some reason setting state in the countdown widget (which should only redraw the text every second) triggers a rebuild of its parent widget. Can't figure out why,
Ответитьbut what if we didnt have any setState inside the helper method ? is it still okay to use helper method ?
Ответитьi wish there was some way around this. helper methods make things so much easier
if i have to create classes i have to pass in parameters and all code is more verbose
I use methods to format code. So should I use classes for formatting also? I like it being seperated bcoz it makes me reading it easier.
ОтветитьNext time wear a Batman like mask :D
Ответитьthanks ☺️☺️☺️
ОтветитьI always used to use class constructors, because it makes code looks more readable and clearer for me. It's happy to hear that there are more valuable advantages too 😊.
ОтветитьWell damn, guess i'll have to refactor my entire app
ОтветитьIts also bad to debug because the helper method is not visible in the debug widget tree
Ответитьi like your explanation style and pace... slow and clear with simple examples , makes it really easy to absord
ОтветитьThanks! Although I knew it already I needed to hear it from the flutter team again 😅!
ОтветитьThank you!
ОтветитьClasses are always great since you can isolate them to a separate file. As your app grows bigger and complex, it becomes easier to fix bugs when things are isolated. The logic is also easier to follow when code is broken down instead of having over 2000 lines in a single file
Ответить"Classes have a better default behavior. The only benefit of methods is having to write a tiny bit less code. There's no functional benefit."
- Remi Rousselet
Hi sir i am beginner in a flutter
Can you please learn me one program that
1. Write dart program to generate random number of dice using class and object
2. How to use class in list and map in a dart
Greeeat video, it helped me a lot!
As a novice in flutter I've started to use different classes for widgets right from the beginning as it felt logical for me. But watching more and more tutorials I've found out that people in them use helper method extensively and switched to that approach as it seemed easier to transfer data that way.
Now, this video put thing in correct perspective and explains why it's not the best way
thanks, i understand more something from your video!!!!
ОтветитьStatefulBuilder?
Ответитьis there a possibility that flutter will have a drag and drop method to create app in the future?
ОтветитьThat's kinda counterintuitive for a React Developer, where functional components (aka widgets) are preferred over class components. Would be great, if Flutter could somehow elevate functional widgets (aka helper methods) to the same level of performance as class widgets.
ОтветитьThanks so much.
Help me from the end of death on boilerplate coding.
😁👍
I am still a Flutter intermediate programmer so I don't know much about performances, but I never liked that helper method style. I always use the classes way because it feels more natural (at least to me).
ОтветитьVery articulate and concise delivery!
ОтветитьThough this is not the right platform to ask...I am struggling in building an android app with flutter.. apk is not building.. There is an error in build.gradle file.. It says
could not resolve properties..even stack overflow could not resolve my query
Solved the biggest confusion I was having. Thanks
Ответить