Flutter_object_form_field

Form field allowing any type of field (date time, custom object, ...).
Alternatives To Flutter_object_form_field
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Tcomb Form Native3,162499187 months ago53October 11, 2018128mitJavaScript
Forms library for react-native
Mui Rff4031122 months ago120September 27, 202211mitTypeScript
MUI 5 / Material UI + React Final Form
Simple React Validator26638203 months ago38October 06, 202219mitJavaScript
A simple react form validator inspired by Laravel validation.
Material Datetime Picker2371744 years ago11April 28, 201730otherJavaScript
A material design date-time picker for the web
Fuzzydateformatter118
7 years ago3Java
Android formatter for fuzzy date and time
Ssforms97
3 years ago6gpl-3.0Java
SSForms is Android library to create dynamic Recyclerview forms
Schedulable81
5 years ago29mitRuby
Handling recurring events in rails
Anjlab Widgets54
97 years ago27January 18, 201611mitCoffeeScript
UI Widgets on top of anjlab-bootstrap-rails
Awesome_fields47
14 years agomitRuby
A Rails plugin to improve forms. Includes a better FormBuilder and DRYness for form fields.
Angular Schema Form Datepicker45
5 years ago3May 31, 201720mitJavaScript
Datepicker add-on for Angular Schema Form using pickadate!
Alternatives To Flutter_object_form_field
Select To Compare


Alternative Project Comparisons
Readme

flutter_object_form_field

Working with TextFormField is nice until you want to work with something other than String. For example, if you want invoke date timer picker, you have to create a focus node, listen for focus, show the dialog when needed. If you do not want to use some special object to store the selected value, you will end up with parsing the data before save just because TextFormField only works with String.

This library provides ObjectFormField<T> that works much better for these cases. You provide it with a function that turns your object into String and a picker async function that returns newly picked object (DateTime from date picker).

Usage

To use this plugin, add flutter_object_form_field as a dependency in your pubspec.yaml file.

Examples


//
// USAGE WITH CUSTOM OBJECT
//
ObjectFormField<Emotion>(
  objectToString: (emotion) => emotion?.name,
  pickValue: (oldEmotion) async {
    // returns an emotion object
    return await Navigator.push(
        context,
        MaterialPageRoute(
            builder: (context) => EmotionsPage()));
  },
  decoration: InputDecoration(labelText: 'Emotion'),
  validator: (value) {
    if (value == null) {
      return 'You have to pick an emotion';

    if (value.name == 'Sadness') {
      return 'Show me your smile!';
    }
  },
),
//
// USAGE WITH DATE TIME
//
ObjectFormField<DateTime>(
  // can use some kind of formatter
  objectToString: (dateTime) => dateTime?.toString(),
  pickValue: (oldDate) async {
    return await showDatePicker(
      context: context,
      initialDate: DateTime.now(),
      firstDate: DateTime(1900),
      lastDate: DateTime(2100),
    );
  },
  decoration: InputDecoration(labelText: 'Date'),
  validator: (value) {
    if (value == null) {
      return 'You have to select date';
    }
  },
),

Contribution and Support

Contributions are welcome!
If you want to contribute code please create a PR
If you find a bug or want a feature, please fill an issue

Popular Date Projects
Popular Form Projects
Popular Libraries Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Dart
Flutter
Form
Date
Picker
Datepicker