flutter_input library

Provides input widgets for data manipulation which can be used standalone or within a form.

An input widget is used to change the value of a variable through user interaction. This library provides input widgets for all types of variables: bool, int, double, String and DateTime. 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:


This library is based on the following design criteria:

  1. Provide an easy to understand library for data input which is easy to use, to maintain and to extend.
  2. All input widgets share a common set of parameters (see InputField).
  3. The InputForm provides a central data object. InputForm.value is a Map which can be nested. The form provides methods to enable() , validate() or save() the values from all input widgets.
  4. An input widget automatically attaches itself to the InputForm by its parameter InputField.path. This parameter is also used to obtain an initial value and to save back the widget value after editing.
  5. Any input widget can be used stand alone, even when it is a descendant of a form. For this, path must be null and onChanged must not be null.
  6. Input widgets inherit as much decoration from the form as possible while this can still be overwritten by the input widget.
  7. Each input widget accepts a list of reusable validators by parameter InputField.validators like 'NotNull', 'Min', 'Max', 'Future', 'Past', ...
  8. 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.
  9. 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.
    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>(T newValue) → void
    Signature for being notified when a form field changes value. [...]
    InputValidator(dynamic value) String
    Signature for validating a form field. [...]
    ValueTransformer<S, T>(T value) → S
    Transform a value of type T into a value of type S. [...]