Newsletter
Subscribe to our Flutter newsletter!
By submitting your email you agree to receive the content requested and to LeanCode's Privacy Policy
Home
Glossary

Forms in Flutter

Form + setStateprovider / bloc / riverpodadvanced_forms
Setup
NoneApp-wide state solutionOne pub.dev package, no framework on top
Values and errors
Per field, in widget StateModeled by hand per formTyped field controllers with built-in error state
Async validation
Hand-written, easy to raceHand-writtenDebounced, with timeout, failure handling and cached answers
Cross-field rules
Shared TextEditingControllerHand-writtensubscribeToFields re-runs a validator when its dependencies change
Dynamic sections
Fields toggled in the tree; a removed field loses its stateHand-writtenSubforms attached and detached at runtime, values kept
Testing
Widget testsUnit tests of your modelUnit tests of the controller, no widget tree
Best for
A few fields with sync rulesApps that already model forms as stateSign-up, checkout, multi-step wizards

Learn more

UI Testing in Flutter by LeanCode

The Role of UI Testing in Large-Scale Applications

We dive into the topic of UI testing in Flutter. Read more about automated UI tests' benefits and available solutions and why UI testing plays a crucial role, especially in large-scale applications.

12 Flutter & Dart Code Hacks
by LeanCode

24 Flutter & Dart Code Hacks & Best Practices – How to Write Better Code?

In this article, we’re sharing LeanCode’s 24 practical Flutter and Dart patterns that help you write less boilerplate, make your code cleaner, and catch mistakes earlier. Apply these patterns and you'll find yourself coding faster, communicating more clearly with your teammates, and spending less time debugging issues that the compiler could have caught.

Flutter architecture by LeanCode

Feature-Based Flutter App Architecture - LeanCode

Read about the LeanCode approach to Flutter architecture. We highlight some of the design decisions that should be made when developing a feature in mobile apps. This includes our approach to dependency injection, state management, widget lifecycle, and data fetching.