FormOption class
Represents a single option item for form components like dropdowns, radios, and chips.
FormOption encapsulates a key-value pair where value is the actual data stored/returned and label is the human-readable text displayed to users.
Example usage:
final option = FormOption(value: 'us', label: 'United States');
print(option.label); // United States
print(option.value); // us
Constructors
- FormOption({required String value, required String label})
-
Creates a FormOption with the specified value and label.
const
-
FormOption.fromJson(Map<
String, dynamic> json) -
Creates a FormOption from a JSON map.
factory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts this FormOption to a JSON map representation.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override