Form Field
Complete form input with label, validation, and error handling.
Installation
bash
flutter_studio add formfieldbash
flutter pub add flutter_studioUsage
dart
CustomFormField(
label: 'Email Address',
placeholder: 'your@email.com',
helperText: 'We will never share your email',
validator: (value) {
if (value?.isEmpty ?? true) {
return 'Email is required';
}
if (!value!.contains('@')) {
return 'Please enter a valid email';
}
return null;
},
onChanged: (value) {
print(value);
},
)API Reference
Properties
| Property | Type | Default | Description |
|---|---|---|---|
label | String | required | Field label |
placeholder | String? | null | Placeholder text |
validator | Function? | null | Validation function |
helperText | String? | null | Helper text below field |
