DropDownModel<T> class
A generic model class for representing items in a dropdown menu.
This class is designed to store an item with a key, a value, and a display text. It also provides methods for equality comparison and string representation.
Constructors
- DropDownModel.new({required String key, T? value, required String text, Widget? prefixWidget, bool disabled = false, String? disabledText})
- Constructor for creating a DropDownModel instance.
Properties
- disabled → bool
-
A boolean indicating whether the dropdown item is disabled.
final
- disabledText → String?
-
A string that will be displayed when the dropdown item is disabled.
final
- hashCode → int
-
Returns a hash code based on the key.
no setteroverride
- key → String
-
A unique identifier for the dropdown item.
final
- prefixWidget → Widget?
-
A widget that will be displayed before the text in the dropdown
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
The text that is displayed in the dropdown for this item.
final
- value → T?
-
The associated value for the dropdown item. The type of value is generic
T
.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
Returns the text representation of the item.
override
Operators
-
operator ==(
Object other) → bool -
Compares two DropDownModel objects based on their key.
override