Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Tcomb Form Native | 3,162 | 499 | 18 | 7 months ago | 53 | October 11, 2018 | 128 | mit | JavaScript | |
Forms library for react-native | ||||||||||
Mui Rff | 403 | 1 | 12 | 2 months ago | 120 | September 27, 2022 | 11 | mit | TypeScript | |
MUI 5 / Material UI + React Final Form | ||||||||||
Simple React Validator | 266 | 38 | 20 | 3 months ago | 38 | October 06, 2022 | 19 | mit | JavaScript | |
A simple react form validator inspired by Laravel validation. | ||||||||||
Material Datetime Picker | 237 | 17 | 4 | 4 years ago | 11 | April 28, 2017 | 30 | other | JavaScript | |
A material design date-time picker for the web | ||||||||||
Fuzzydateformatter | 118 | 7 years ago | 3 | Java | ||||||
Android formatter for fuzzy date and time | ||||||||||
Ssforms | 97 | 3 years ago | 6 | gpl-3.0 | Java | |||||
SSForms is Android library to create dynamic Recyclerview forms | ||||||||||
Schedulable | 81 | 5 years ago | 29 | mit | Ruby | |||||
Handling recurring events in rails | ||||||||||
Anjlab Widgets | 54 | 9 | 7 years ago | 27 | January 18, 2016 | 11 | mit | CoffeeScript | ||
UI Widgets on top of anjlab-bootstrap-rails | ||||||||||
Awesome_fields | 47 | 14 years ago | mit | Ruby | ||||||
A Rails plugin to improve forms. Includes a better FormBuilder and DRYness for form fields. | ||||||||||
Angular Schema Form Datepicker | 45 | 5 years ago | 3 | May 31, 2017 | 20 | mit | JavaScript | |||
Datepicker add-on for Angular Schema Form using pickadate! |
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).
To use this plugin, add flutter_object_form_field as a dependency in your pubspec.yaml file.
//
// 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';
}
},
),
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