TGViewer
DART 🎯 FLUTTER DART 🎯 FLUTTER @dartside · 2.78K subscribers
Post #3069 345

Forwarded from Dart: Tips Of The Day

Flutter forms without packages — everything is already in the SDK

Listenable.merge combines any controllers into a single subscription point. One listener — all validation:

final username = TextEditingController();
final agreed = ValueNotifier<bool>(false);
final focus = FocusNode();

final form = Listenable.merge([username, agreed, focus]);
form.addListener(_validate);


In _validate — all rules in one place, cross-field logic included. Results go into two notifiers:

formError.value = 'Username is required';
formValid.value = false;


Wrap only the submit button in ValueListenableBuilder<bool> — nothing else rebuilds.
Dispose in one pass:

[username, agreed, focus]
.whereType<ChangeNotifier>()
.forEach((c) => c.dispose());


Works with TextEditingController, ValueNotifier<T>, FocusNode, AnimationController, and any ChangeNotifier.
No packages, no new mental model.

Full article with a breakdown of all field types and a live DartPad example

#TipOfTheDay #Dart #Flutter #plugfox #form #state #managment
Plague Fox Form State Management Flutter's SDK already has everything you need to manage complex forms — no packages required. Listenable.merge turns any combination of ValueNotifier, TextEditingController, FocusNode, and ChangeNotifier into a single reactive form controller.
  • 🔥 6
More from @dartside
  1. Oct 10, 2026The new #flutter #video "Showing your non-dev friend hot reload" has arrived ▶️🍿 When you…
  2. Oct 9, 2026🐙 Trending Repository: flutter_carplay ⭐421 🚗 Apple CarPlay and Android Auto for Flutter…
  3. Oct 9, 2026The new #flutter #video "Flutter’s focus system | Vadym Pinchuk" has arrived ▶️🍿 Think fo…
  4. Oct 9, 2026A new #flutter #version 3.47.7 is available 🕊️😍 • Changelog • Flutter release notes • Fl…
  5. Oct 9, 2026🐙 Trending Repository: Fladder ⭐2636 Fladder - A cross-platform Jellyfin Frontend built o…
  6. Oct 8, 2026🐙 Trending Repository: jasmine ⭐5466 A comic browser,support Android / iOS / MacOS / Wind…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →