Package selection guidance compiled from public package information, community data, and project usage.
go_form is a Flutter/Dart package that provides a generic controller for managing form input state, validation, errors, and focus. It simplifies handling form fields by offering initial values, real-time validation, error tracking, and focus management. Designed for clean, reusable form logic, it reduces boilerplate and enhances developer productivity. The package supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for cross-platform applications. Its lightweight and intuitive API enables seamless integration into existing forms.
Use cases
Managing dynamic forms with multiple inputs
Implementing real-time validation
Handling form submission with error feedback
Creating reusable form components
Simplifying form state management across screens
Supporting focus navigation between fields
Key features
Generic input field controller
Real-time validation support
Error message management
Focus control for input fields
Initial value configuration
Cross-platform compatibility
Suitable for
Developers building complex forms in Flutter
Teams seeking reusable form logic
Apps requiring robust input validation
Projects targeting multiple platforms
Frontend developers wanting minimal boilerplate
Considerations
Requires understanding of Flutter's state management
May need additional styling for custom UI
Not suitable for very simple one-off forms
Depends on proper initialization to avoid runtime errors
Limited to form-specific use cases without broader state management
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
GoForm is a powerful library for managing forms in Flutter.
It allows you to dynamically create, validate, and manage form state
without the need to manually handle controllers for each field.
Features of GoForm
Smart validation with minimal code
GoForm automatically validates input using standard validators,
eliminating the need to manually write validation logic for each field.
Flexibility for any field types
Create any form elements — from simple text fields and checkboxes
to complex file pickers and dropdown menus.
GoForm seamlessly adapts to any UI structure.
Centralized error management
Set and reset errors anywhere in your code,
without needing to use setState().
Error display is fully automated and updates without unnecessary re-renders.
Debounced value changes
Fields can debounce rapid input changes using debounceDuration, reducing unnecessary processing or validations.
Asynchronous validation
Add asyncValidator to a field to perform validation that requires waiting for server responses or background
checks.
Use formController.validateAsync() to trigger validation across all fields.
Advanced focus management
The FormController provides built-in methods for controlling focus between fields:
focus(String name) – focuses the field with the given name.
unfocus(String name) – removes focus from the specified field.
unfocusAll() – removes focus from all fields.
focusNext(String name) – moves focus to the next field.
focusPrevious(String name) – moves focus to the previous field.
focusFirstError() – focuses the first field that has a validation error.
hasFocus(String name) – returns true if the field is currently focused.
hasError(String name) – returns true if the field currently has an error.
Comparison of standard Flutter tools and GoForm
Feature
GoForm
Standard Flutter
Field management
Fields are registered automatically
Each field requires a TextEditingController
Field flexibility
Supports any fields (text, files, checkboxes)
Only TextFormField and standard widgets
Error handling
Errors are set via FormController.setError()
Errors can only be handled in validator
Centralized state management
A single FormController manages the entire form
Field states must be tracked manually
Retrieving values
formController.getValues() returns a Map<String, dynamic>
Requires accessing TextEditingController.text
Resetting fields
formController.resetAllFields()
Controllers must be cleared manually
Handling server-side errors
Errors can be set using setError()
Errors must be stored in setState()
How to Install
Add the dependency to pubspec.yaml:
dependencies:go_form:latest_version
Replace latest_version with the latest version from pub.dev.
Quick Start
Creating a Form with Dynamic Fields
In DynamicForm, simply pass a list of fields and a controller:
You can override the onInit method inside your custom field to perform one-time setup logic.
This is useful for asynchronous operations, such as fetching initial data or triggering a service.