go_form은 폼 입력 상태, 검증, 오류 및 포커스를 관리하기 위한 일반적인 컨트롤러를 제공하는 Flutter/Dart 패키지입니다. 초기 값, 실시간 검증, 오류 추적 및 포커스 관리를 통해 폼 필드 처리를 단순화합니다. 깔끔하고 재사용 가능한 폼 로직을 설계하여 빌더플레이트 코드를 줄이고 개발자 생산성을 향상시킵니다. Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼을 지원하며, 크로스플랫폼 애플리케이션에 이상적입니다. 가볍고 직관적인 API는 기존 폼에 쉽게 통합할 수 있도록 합니다.
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.