simple_dart_select_field 0.0.3
simple_dart_select_field: ^0.0.3 copied to clipboard
SelectField Component
SelectField #
A selection field from a drop-down list or from a simple list with the ability to select multiple items.
Read in other languages: English, Русский.
You must initialize initOptions(List
Properties #
- multiple - multiple choice
- size - the number of visible elements in the list
- adapter - adapter for displaying list items (Default: toString)
T - type of list elements
When using elements other than String, you must set the adapter before initializing the options.
Example #
class SelectableObject {
String name = '';
SelectableObject(this.name);
}
SelectField<SelectableObject>
()..adapter = (
(obj) => obj.name)
..initOptions([
SelectableObject('object1'),
SelectableObject('object2'),
SelectableObject('object3'),
SelectableObject('object4')
])