flutter_input library

Provides input widgets (fields) for data manipulation and a form which collects this fields. The form provides common attributes to all fields and allows enable(), reset(), save() and validate() all fields at once.

An input widget is used to change the value of a variable by some user interaction. This library provides input widgets for all types of variables: bool, int, double, String and DateTime. The variable can be a single value or a value in a map. The map can even be nested. Its value is accessed by a 'path' string.

All input widgets share a common set of parameters which makes them easier to use. This common set of parameters can be found at InputField.

Input Utilities

Form and some input widgets rely on utility methods which can be used anywhere:

DateHelperExtension provides extensions for DateTime objects:

  • DateHelperExtension.isSameDay compares only the date not the time
  • DateHelperExtension.julianDay computes the Julian Day
  • DateHelperExtension.weekOfYear gets the week of year [1..53]


This library is based on the following design criteria:

  1. Provide an easy to understand library for data manipulation which is easy to use, to maintain and to extend.
  2. All input widgets share a common set of parameters (see InputField).
  3. Input widgets can be used standalone but will automatically attach to any InputForm ancestor.
  4. The InputForm provides central handling of the common parameter which will be used by all child fields but can be overwritten there.
  5. The InputForm provides methods to enable() , reset(), save() or validate() all input widgets from one central place.
  6. The value of an input widget is either given by initialValue and written through save() or it is taken from and written to a map.
  7. The map can be centrally supplied to the form or individually at each input widget
  8. Using the map or the initial value can be shared. Even both can be used together.
  9. Input widgets inherit as much decoration from the form as possible while this can still be overwritten at the input widget.
  10. Each input widget accepts a list of reusable validators by parameter InputField.validators like 'NotNull', 'Min', 'Max', 'Future', 'Past', ...
  11. Input widgets do not have parameters for type conversion. If this is required in some case, just use your converter on parameters initialValue and onSave. Maybe this still requires further analysis.
  12. All input widgets should have an ".adaptive" constructor allowing them to be used by Android and iOS. (Not implemented yet)


Provides static methods for date computations which are not available in Dart 2.7.0. [...]
Styles for an InputDatePicker.
All styles for a date picker. [...]
Provides a checkbox to manipulate a bool value.
An input widget to select a country code from a sorted list of country names. [...]
Input widget for a date picker. [...]
Provides a date picker for a DateTime value. [...]
An input widget for date and / or time. [...]
Provides a drop down button for a selection list
Provides a favorite button to set a bool value. The icons for a favorite or not can be set separately.
This base class must be extended by all input widgets. [...]
The current state of an InputField.
                • Regularly check this issues in GitHub - - - - - - -
  • [...]
    State associated with an InputForm widget. [...]
    An InputField that contains a TextField for one of type String, int or double. [...]
    Provides a text with the current language and a trailing icon. [...]
    Provides a text input field to enter a password. A button allows to make the password visible.
    Provides a group of radio buttons which can be aligned vertically (default) or horizontally by setting parameter direction.
    Provides a horizontal rating displaying empty, half and full icons. This 3 icons can be given as parameters. They default to stars. The rating value can be set with parameters min (default = 0), max (default = 100) and initialValue (default = 1). [...]
    Provides a slider to select a value with type double between a given minimum and a given maximum.
    InputSpinner<T extends num>
    Provides a spinner to set a value between min and max. [...]
    Provides a switch to manipulate a bool value
    An InputField that contains a TextField. [...]
    Provides utility methods used by package flutter_input: [...]


    Extensions on DateTime. [...]


    monthNamesLong List<String>
    monthNamesShort List<String>
    weekDaysLong List<String>
    Long names for the days of the week. 1 = Monday, ..., 7 = Sunday
    weekDaysShort List<String>


    after(DateTime fieldValue, DateTime checkValue, {String message}) String
    Contains standard validators which can be attached to an input field. [...]
    before(DateTime fieldValue, DateTime checkValue, {String message}) String
    Validates that fieldValue (DateTime) is before checkValue. [...]
    future(DateTime fieldValue, {String message}) String
    Validates that fieldValue (DateTime) is in the future. [...]
    max(num fieldValue, int maxVal, {String message}) String
    Validates that fieldValue (int or double) is equal to or smaller than maxVal. [...]
    maxLength(String fieldValue, int maxLen, {String message}) String
    Validates that the string fieldValue is not longer than maxLen. [...]
    min(num fieldValue, int minVal, {String message}) String
    Validates that fieldValue (int or double) is equal to or larger than minVal. [...]
    minLength(String fieldValue, int minLen, {String message}) String
    Validates that the string fieldValue is not shorter than minLen. [...]
    notNull(dynamic fieldValue, {String message}) String
    Checks if the given value is not null.
    past(DateTime fieldValue, {String message}) String
    Validates that fieldValue (DateTime) is in the past. [...]


    Enumeration of formats for dates and times.
    Enumeration about which part of a DateTime object is used. A value of 'null' is treated same as dateAndTime. Should be part of DateTime class.


    InputFieldSetter<T> = void Function(T newValue)
    Signature for being notified when a form field changes value. [...]
    InputValidator = String Function(dynamic value)
    Signature for validating a form field. [...]
    ValueTransformer<S, T> = S Function(T value)
    Transform a value of type T into a value of type S. [...]