Avoid using StatefullWidget!

  Рет қаралды 7,666

Codrut Erdei

Codrut Erdei

Жыл бұрын

Lifting state up and state: • State Management! Flut...
In this video, I'm addressing why I think using StatefulWidget is not adequate for production applications or for any big Flutter project.

Пікірлер: 13
@DraskoSaric
@DraskoSaric Жыл бұрын
Now I completely agree with you. 😀 You summarized it in very simple and understandable way. Bottom line: avoid to use them as much as possible. 😉
@_undecided
@_undecided Жыл бұрын
People not really understand StatefulWidget widget. StatefulWidget have more important things as set state. To change state you use ValueNotifier or any other state management. StatefulWidget used to check widgets life circle as on dispose, init state and the rest. All important elements in the Flutter is based on the StatefulWidget.
@codruterdei
@codruterdei Жыл бұрын
I actually said that in the video 😊
@johnjackson6262
@johnjackson6262 Жыл бұрын
Except for text controllers / other controllers, custom widgets you make, when you need a simple callback not tied to bloc so you can reuse it, when your passing copies of bloc as a parameter so you don't have app wide scope of the bloc...
@ymts_vladyslav3707
@ymts_vladyslav3707 Ай бұрын
I have seen people exactly with the same problem. They were studying their employees to use blocs as a state without stateful widgets, even including text controllers, scaffold keys and etc...
@RandalLSchwartz
@RandalLSchwartz 11 ай бұрын
StatefulWidgets are just fine when you need ephemeral state for a widget that has a lifetime coincident with the widget and survives between builds. Yes, for any state that is shared beyond this scope or lifetime, you'll reach for a state management solution (my preference is Riverpod). But it seems like you're throwing the baby out with the bathwater in this video. The proper stance is a bit more tolerance.
@maddyIncubus
@maddyIncubus 10 ай бұрын
Most of the flutter related debates seem to have already taken place in the reactJs community I suppose. Using state in component may not be a useful as states need to be lifted and hence Redux, etc. Have seen similar vids where all the debates seem like deja vu :) Maybe someone has to do a vid of the similarity between React and Flutter, from a comcepts point of view (even build() is similar to render() ).
@twitchpop4140
@twitchpop4140 Жыл бұрын
It would be interesting to watch about navigation tools)
@codruterdei
@codruterdei Жыл бұрын
Like go_router?
@twitchpop4140
@twitchpop4140 Жыл бұрын
@@codruterdei Yep, there are more options.
@nathanielgreen8776
@nathanielgreen8776 Жыл бұрын
Just a note: Your current thumbnail says "StatelessWidget sucks" but this video is about StatefulWidget
@codruterdei
@codruterdei Жыл бұрын
OMG :O
Stateless vs Stateful | Flutter Example
6:45
Learn Flutter with Me
Рет қаралды 18 М.
Riverpod Simplified | Easy State Management
14:17
Tadas Petra
Рет қаралды 43 М.
Каха заблудился в горах
00:57
К-Media
Рет қаралды 8 МЛН
State Management! Flutter What's next? #1
23:01
Codrut Erdei
Рет қаралды 7 М.
Learn Flutter Hooks and Maximize Your Code Reuse
10:36
Robert Brunhage
Рет қаралды 61 М.
Managing State in Flutter - Introducing Flutter
5:39
Flutter
Рет қаралды 94 М.
Authentication with Go! Flutter What's next? #3
8:03
Codrut Erdei
Рет қаралды 2,7 М.
Flutter State Management - The Grand Tour
14:07
Fireship
Рет қаралды 239 М.
Best Flutter libraries for Polishing your apps before release.
5:20
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 527 М.
Запрещенный Гаджет для Авто с aliexpress 2
0:50
Тимур Сидельников
Рет қаралды 863 М.
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 211 М.
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 6 МЛН