Side effects in Flutter: don’t mutate state inside the build method

Mutating state or calling async code inside the build method can cause unwanted widget rebuilds and unintended behaviour. Here are some examples and rules to follow. https://codewithandrea.com/articles/side-effects-flutter/

созданный 4y | 3 авг. 2021 г., 15:21:22


Войдите, чтобы добавить комментарий

Другие сообщения в этой группе

February 2025: Flutter 3.29, Dart 3.7, Shorebird & Jaspr Updates, New Formatting Style, TextFormField Mistakes

Also included: Flutter rendering changes, discontinued official packages, Dart macros update, new Flutter UI challenges from Code with Andrea. https://codewithandrea.com/newsletter/february-2025/

24 февр. 2025 г., 14:50:16 | Code with Andrea
Wildcard Variables in Dart 3.7

Since Dart 3.7, the _ character is a wildcard variable and you can use it more than once in your code, without causing name collisions. https://codewithandrea.com/tips/wildcard-variables-dart-3-7/

14 февр. 2025 г., 09:10:07 | Code with Andrea
New Formatting Style in Dart 3.7

Dart 3.7 introduces a new formatter that automatically adds or removes trailing commas, based on the max line length. https://codewithandrea.com/tips/new-formatting-style-dart-3-7/

14 февр. 2025 г., 09:10:06 | Code with Andrea
There's a New Formatting Style in Dart 3.7 (Here's What It Means for You)

Dart 3.7 introduces a new formatter that changes how your Flutter code is formatted. Learn what’s new and how to prepare your codebase. https://codewithandrea.com/articles/new-formatting-style-dart-3-

13 февр. 2025 г., 14:40:02 | Code with Andrea
Wildcard Variables in Dart 3.7

Since Dart 3.7, the _ character is a wildcard variable and you can use it more than once in your code, without causing name collisions. https://codewithandrea.com/tips/wildcard-variables-dart-3.7/

13 февр. 2025 г., 09:50:06 | Code with Andrea
Hotkeys with CallbackShortcuts

The CallbackShortcuts widget makes it easy to add keyboard shortcuts to your Flutter app. Here's how to use it. https://codewithandrea.com/tips/hotkeys-callback-shortcuts/

11 февр. 2025 г., 16:20:04 | Code with Andrea
Responsive Split View in Flutter

Here's how to create a responsive split-view widget that works on mobile, desktop and web. https://codewithandrea.com/tips/responsive-split-view-flutter/

10 февр. 2025 г., 17:10:06 | Code with Andrea