Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Flutter_form_builder | 1,236 | 12 | 17 | 7 days ago | 147 | July 13, 2022 | 57 | bsd-3-clause | Dart | |
Simple form maker for Flutter Framework | ||||||||||
Jh_flutter_demo | 557 | 5 days ago | 1 | bsd-2-clause | Dart | |||||
flutter项目- 实现一些常用效果、封装通用组件和工具类 | ||||||||||
Card_settings | 431 | 10 | 1 | 5 months ago | 77 | October 08, 2021 | 22 | mit | Dart | |
A flutter package for building card based forms. | ||||||||||
Form_bloc | 397 | 5 | 1 | 6 months ago | 48 | December 06, 2021 | 94 | Dart | ||
🔥 Dart and Flutter Package 🔥 Easy Form State Management using BLoC pattern 🔥 Wizard/stepper forms, asynchronous validation, dynamic and conditional fields, submission progress, serialization and more! 🔥 | ||||||||||
Reactive_forms | 353 | 12 | a month ago | 96 | August 07, 2022 | 53 | mit | Dart | ||
This is a model-driven approach to handling form inputs and validations, heavily inspired in Angular's Reactive Forms | ||||||||||
Flutter_dynamic_forms | 127 | 1 | 3 | 2 years ago | 13 | May 30, 2021 | 15 | mit | Dart | |
A collection of flutter and dart libraries allowing you to consume complex external forms at runtime. | ||||||||||
Modal_progress_hud | 116 | 50 | 13 | 3 years ago | 10 | March 19, 2019 | 3 | mit | Dart | |
A simple modal progress HUD (heads-up display, or progress indicator) for flutter | ||||||||||
Json_to_form | 95 | 1 | 23 days ago | 3 | February 02, 2020 | 12 | apache-2.0 | Dart | ||
A flutter plugin to use convert Json to Form | ||||||||||
Survey_kit | 90 | 2 months ago | 14 | mit | Dart | |||||
Flutter library to create beautiful surveys (aligned with ResearchKit on iOS) | ||||||||||
Lo_form | 77 | 3 months ago | 10 | September 02, 2022 | 2 | other | Dart | |||
🧪 Lightweight Flutter forms library |
This package provides input widgets (fields) to manipulate data.
The data to manipulate is either a single variable or an entry in a map
.
The map can even be nested.
Parameter path
defines the key to access the entry in the map.
To access an entry in a nested map, the keys must be separated by a single
slash (/
) character.
All input widgets share a common set of parameters and methods. A list of validators can be attached to each input widget.
Each input widget can be used standalone.
If it finds a InputForm
ancestor then it will automatically
register itself to the form.
The form provides methods to enable()
, reset()
, save()
or validate()
all fields at once.
The following input widgets are available. See section Development below for building your own input widget.
InputCheckbox
- Checkbox for data type bool
InputCountry
- Dropdown to select a country (shows flags)InputDate
- Calendar based selection for data type DateTime
(date part only)InputDatePicker
- A highly customizable date picker with week of year and multiple swipe actionsInputDateTime
- Wheels for data type DateTime
can be customized for date only, time only or bothInputDropDown<T>
- Dropdown button for data type T
InputFavorite
- A favorite button with selectable icon for data type bool
InputKeyboard
- Text input for data type String
, int
or double
InputLanguage
- Dropdown to select a language (Locale
)InputPassword
- Text field with a switch to make obscured input visible (String
)InputRadio<T>
- Radio button to select one value of type T
InputRating
- Rating widget with selectable icons and a range slider for data type int
InputSlider
- Slider for data type double
between a minimum and maximum valueInputSpinner
- Spinner with buttons for data type double
to decrease or increase a value
between a minimum and maximumInputSwitch
- Switch for data type bool
All input widgets share a common set of parameters. All parameters are named and optional.
Key key
- Identifier for the fieldbool autosave = true
- automatically saves any changed value.
If autovalidate is true
then the value will only be changed
when there are no validation failures.bool autovalidate = false
- automatically validates changed valuesInputDecoration decoration
- e.g. for a label (see example)bool enabled
- to enable or disable user input.
If not set then uses setting from InputForm
or defaults to true
(if there is no form).T initialValue
- sets the fields initial value.
Overrides using the value from map
.ValueSetter<T> onChanged
- invoked on every change
of the input field valueValueSetter<T> onSaved
- invoked by save()
which
will be automatically called by InputForm.save()
.String path
- to access the value in map
List<InputValidator> validators
- list of validatorsThe following validators can be given to parameter validators
of an input widget. Each validator accepts the optional parameter
message
to set an individual error message if the validation fails.
after(DateTime date)
- validates that the field value
is after date
before(DateTime date)
- validates that the field value
is before date
future
- validates that the DateTime field value
lies in the futuremax(num maxVal)
- validates that the num field value
is not larger than maxVal
maxLen(num maxLen)
- validates that the length of the String
field value is not longer than maxLen
min(num minVal)
- validates that the num field value
is not smaller than minVal
minLen(num minLen)
- validates that the length of the String
field value is not shorter than minLen
notNull
- validates the the field value is not emptypast
- validates that the DateTime field value
lies in the pastEach input widget will automatically register itself if it
finds an InputForm
ancestor.
Otherwise it will just run standalone.
It will use initialValue
for its value to display.
If initialValue is null
then it will use the value from
map[path]
if both are set.
If map
is not set, then the field will use map
from
an InputForm
ancestor (if there is any).
Saving a modified value will happen
autosave = true
(which is the default)save()
is calledsave()
is called on the InputFormState
The changed value will be written to the map
at path
if both were supplied. Also method onSave()
will be invoked
with the changed value.
For a complete example see example/main.dart
.
The highly customizable InputDatePicker
allows you to choose a date
from a calendar page which also shows the week of the year.
It provides spinners, swipes and a dropdown to select the month.
The year can even be entered as text.
All parts can be customized by DatePickerStyles
.
To create a new input field for data type T
follow these steps:
T
with the value type of your new input field.super()
with
all the common parameters.build( BuildContext context)
in the state class.
It must end with return super.buildInputField( context, ...
where
...
is the code to display your new field widget.This package also contains some utilities.
InputUtils.convertToType()
converts a value to a given target type.InputUtils.readFromJson()
reads a value from a nested map.InputUtils.writeToJson()
writes a value into a nested map.date_helper.dart
for extensions on DateTime
for weekOfYear
, julianDay
and more.