flutter_fast_forms 2.1.0 flutter_fast_forms: ^2.1.0 copied to clipboard
Enhances the Flutter SDK with form field wrappers, adaptive form field widgets and validation states to speed up form development.
Flutter Fast Forms #
Flutter Fast Forms is a Dart package for building Flutter forms fast.
It adds these missing pieces to the Flutter SDK to make Flutter form development a breeze:
FormField<T>
wrappers for all Material / Cupertino input widgets according to the already built-in TextFormField / DropdownButtonFormField- adaptive and highly customizable
FastFormControl<T>
widgets with support of validation states. FastForm
widget that provides current form field valuesonChanged
- common
FormFieldValidator<T>
functions
Getting Started #
1. Add a FastForm
to your widget tree:
class MyFormPage extends StatelessWidget {
MyFormPage({Key? key, required this.title}) : super(key: key);
final formKey = GlobalKey<FormState>();
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: SafeArea(
child: SingleChildScrollView(
child: FastForm(
formKey: formKey,
children: [],
),
),
),
);
}
}
2. Add FastFormControl<T>
children to build up your form:
child: FastForm(
formKey: formKey,
children: [
FastTextField(
id: 'field_destination',
label: 'Destination',
placeholder: 'Where are you going?',
),
FastDateRangePicker(
id: 'field_check_in_out',
label: 'Check-in - Check-out',
firstDate: DateTime.now(),
lastDate: DateTime.now().add(const Duration(days: 365)),
),
FastCheckbox(
id: 'field_travel_purpose',
label: 'Travel purpose',
title: 'I am travelling for work',
),
],
)
3. Wrap children with FastFormSection
for grouping and consistent padding:
child: FastForm(
formKey: formKey,
children: [
FastFormSection(
header: const Text('My Form'),
padding: EdgeInsets.all(16.0),
children: [
FastTextField(
id: 'field_destination',
label: 'Destination',
placeholder: 'Where are you going?',
),
// ...
],
),
]
)
Widget Catalog #
adaptiveFastFormControl<T> |
adopts Material |
adopts Cupertino |
requires Material Widget ancestor when adaptive: true |
---|---|---|---|
FastAutocomplete |
Autocomplete |
no | yes |
FastCheckbox |
CheckboxListTile |
no | yes |
FastChoiceChips |
ChoiceChip |
no | yes |
FastCalendar |
CalendarDatePicker |
no | yes |
FastDatePicker |
showDatePicker |
CupertinoDatePicker |
no |
FastDateRangePicker |
showDateRangePicker |
no | yes |
FastDropdown |
DropdownButtonFormField <String> |
no | yes |
FastInputChips |
InputChip |
no | yes |
FastRadioGroup |
RadioListTile |
no | yes |
FastRangeSlider |
RangeSlider |
no | yes |
FastSegmentedControl |
no | SlidingSegmenteControl <String> |
no |
FastSlider |
Slider.adaptive |
CupertinoSlider |
no |
FastSwitch |
SwitchListTile |
CupertinoSwitch |
no |
FastTextField |
TextFormField |
CupertinoTextFormFieldRow |
no |
FastTimePicker |
showTimePicker |
no / use FastDatePicker with CupertinoDatePickerMode.time |
yes |