isSelected method
Check selection status of an option. Return true if the option selected.
Which option to check can be defined by the index (String) or by the option (T
) object itself.
This will check and enforce mode constraint.
Implementation
bool isSelected(dynamic o) {
assert(o is String || o is T);
if (o is T) o = indexGetter(o);
return _constrainedSelected().contains(o);
}