SelectEvent<T> class
A select event. It is sent with ViewEvents.select.
class SelectEvent<T> extends ViewEvent { final Iterable<T> _selectedValues; final int _selectedIndex; /** Constructor. * * + [selectedValues] is the set of selected values. It can't be null. * + [selectedIndex] is the index of the first selected value, or -1 * if [selectedValues] is empty. */ SelectEvent(Iterable<T> selectedValues, int selectedIndex, [String type="select", View target]): super(type, target), _selectedValues = selectedValues, _selectedIndex = selectedIndex; /** Returns the selected values. */ Iterable<T> get selectedValues => _selectedValues; /** Returns the first selected value, or null if no selected value. */ T get selectedValue => _selectedValues.isEmpty ? null: _selectedValues.first; /** Returns the first selected index, or -1 if none is selected. * * Notice that [selectedIndex] is meaningless for `TreeModel`. */ int get selectedIndex => _selectedIndex; String toString() => "SelectEvent($target, $selectedValues, $selectedIndex)"; }
Extends
ViewEvent > SelectEvent<T>
Constructors
new SelectEvent(Iterable<T> selectedValues, int selectedIndex, [String type = "select", View target]) #
Constructor.
- selectedValues is the set of selected values. It can't be null.
-
selectedIndex is the index of the first selected value, or -1 if selectedValues is empty.
SelectEvent(Iterable<T> selectedValues, int selectedIndex, [String type="select", View target]): super(type, target), _selectedValues = selectedValues, _selectedIndex = selectedIndex;
Properties
View currentTarget #
inherited from ViewEvent
The view that is handling this event currently.
View currentTarget
final bool isPropagationStopped #
inherited from ViewEvent
Returns whether this event's propagation is stopped.
Default: false.
It becomes true if stopPropagation is called, and then all remaining event listeners are ignored.
bool get isPropagationStopped => _propStop;
final int selectedIndex #
Returns the first selected index, or -1 if none is selected.
Notice that selectedIndex is meaningless for TreeModel
.
int get selectedIndex => _selectedIndex;
final T selectedValue #
Returns the first selected value, or null if no selected value.
T get selectedValue => _selectedValues.isEmpty ? null: _selectedValues.first;
final Iterable<T> selectedValues #
Returns the selected values.
Iterable<T> get selectedValues => _selectedValues;
Methods
void preventDefault() #
inherited from ViewEvent
Prevents the browser's default behavior.
void preventDefault() { }