flutter_form_builder_pro library
flutter_form_builder_pro — schema-driven Flutter form engine.
Quick start
import 'package:flutter_form_builder_pro/flutter_form_builder_pro.dart';
SmartForm(
schema: FormSchema(
fields: [
FieldSchema.text(
id: 'name',
label: 'Full name',
validators: [Validators.required()],
),
FieldSchema.email(
id: 'email',
label: 'Email',
validators: [Validators.required(), Validators.email()],
),
],
),
onSubmit: (values) async {
await api.register(values);
},
)
Custom field types
SmartForm(
schema: schema,
registry: buildDefaultRegistry()
..register(
FieldType.custom('color_picker'),
(ctx) => MyColorPickerWidget(
value: ctx.value as Color?,
onChanged: ctx.setValue,
isDisabled: ctx.isDisabled,
),
),
onSubmit: (values) async { ... },
)
Classes
- AndCondition
- AsyncOptionsSource
- AutosaveConfig
- Configuration for SmartForm's built-in autosave-draft feature.
- AutosaveEngine
- Persists form draft values to a Hive box, debounced so rapid keystrokes never cause redundant writes.
- ContainsCondition
- CustomValidator
- Inline custom validator — quick one-liners without subclassing.
- DateRange
- A start/end date pair — the value type for FieldType.dateRange fields.
- EmailValidator
- Validates email format.
- EqualsCondition
- FieldCondition
- A condition that determines whether a field is visible, required, or disabled, evaluated reactively against the current form values.
- FieldOption
- A single selectable option for dropdown, radio, checkbox-group fields.
- FieldRegistry
- Maps FieldType values (and custom type keys) to their widget builders.
- FieldSchema
- Describes a single form field — its type, label, validators, conditional visibility, and any type-specific configuration.
- FieldValidator
- Base class for all field validators.
- FormFieldContext
- Everything a custom field widget needs — passed by the engine, not by the dev.
- FormSchema
- The root schema for an entire form.
- FormStateNotifier
- Reactive state holder for a flutter_form_builder_pro instance.
- FormStep
- FormTheme
- Visual configuration for a SmartForm.
- FormValidator
- A validator that sees all current form values at once and can return errors for multiple fields simultaneously.
- GreaterThanCondition
- IsEmptyCondition
- IsNotEmptyCondition
- LessThanCondition
- LocalTime
-
A clock time with no date component — the value type for FieldType.time
fields. Equivalent in spirit to Flutter's
TimeOfDay, duplicated here so the schema layer stays Flutter-agnostic. The widget layer converts to/fromTimeOfDaywhen talking toshowTimePicker. - MatchFieldValidator
- Validates that the field value matches another field's value.
- MaxLengthValidator
- Ensures a string value has at most max characters.
- MaxValueValidator
- Ensures a numeric value is at most max.
- MinLengthValidator
- Ensures a string value has at least min characters.
- MinRatingValidator
- Ensures a rating field has at least minStars stars selected.
- MinValueValidator
- Ensures a numeric value is at least min.
- NotCondition
- NotContainsCondition
- NotEqualsCondition
- OptionsSource
- Defines where a field's selectable options come from.
- OrCondition
- PatternValidator
- Validates against a RegExp pattern.
- PhoneValidator
- Validates phone number format (loose: digits, spaces, +, -, parentheses).
- PickedFileInfo
-
Metadata for a single picked file — the per-item value type for
FieldType.file and FieldType.image fields. The field value itself is
always
List<PickedFileInfo>(even when FieldSchema.maxFiles is 1). - RemoteValidator
- Async validator — calls fn and awaits the result.
- RequiredValidator
- Ensures the field has a non-null, non-empty value.
- SmartForm
- SmartFormController
- Programmatic handle for a SmartForm.
- StaticOptionsSource
- StepController
- Controls navigation between wizard steps.
- Validators
- Static factory for all built-in validators.
Enums
- FieldType
- All built-in field types supported by smart_form.
Functions
-
buildDefaultRegistry(
) → FieldRegistry - Builds the default FieldRegistry with all built-in field type mappings.
Typedefs
- FieldWidgetBuilder = Widget Function(FormFieldContext ctx)
- Signature for a custom field widget builder.