TFormService class
A service for displaying form modals with validation.
TFormService provides modal dialogs for forms with:
- Automatic form layout
- Built-in validation
- Save/Cancel actions
- Mobile-friendly with zoom support
- Integration with TFormBase
Usage Example
class UserForm extends TFormBase {
final name = TFieldProp<String>('');
final email = TFieldProp<String>('');
@override
List<TFormField> get fields => [
TFormField.text(name, 'Name', isRequired: true),
TFormField.text(email, 'Email', isRequired: true),
];
@override
String get formTitle => 'Edit User';
}
final result = await TFormService.show(context, UserForm());
if (result != null) {
// Form was saved
print('Name: ${result.name.value}');
}
See also:
- TFormBase for form models
- TModalService for generic modals
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
show<
T extends TFormBase> (BuildContext context, T input) → Future< T?> - Shows a form in a modal dialog.