S2SingleSelected<T> class
Null safety
- Inheritance
-
- Object
- ChangeNotifier
- S2ChosenNotifier<
T> - S2Selected<
T> - S2SingleSelected
- Mixed in types
Constructors
-
S2SingleSelected({required T value, S2Choice<
T> ? choice, S2SingleSelectedResolver<T> ? resolver, S2Validation<S2SingleChosen< ? validation, String? placeholder})T> > - Default constructor
Properties
-
choice
↔ S2Choice<
T> ? -
Returns a single selected S2Choice
covariantread / writeoverride
- error ↔ String
-
Validation error message
read / writeinherited
- group → String?
-
Returns
choice.group
read-onlyinherited - hashCode → int
-
The hash code for this object.
read-onlyinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
read-onlyinherited
- isEmpty → bool
-
Returns
true
if there are no values in the chosen dataread-onlyinherited - isNotEmpty → bool
-
Returns
true
if there is at least one value in the chosen dataread-onlyinherited - isNotResolved → bool
-
Returns
true
if one of choice or value isnull
read-onlyinherited - isNotValid → bool
-
Returns true when the selection is not valid
read-onlyinherited
- isResolved → bool
-
Returns
true
if choice is notnull
read-onlyinherited - isResolving ↔ bool
-
Returns
true
when choice is resolving in the backgroundread / writeinherited - isValid → bool
-
Returns true when the selection is valid
read-onlyinherited
- length → int
-
Returns the length of the choice
read-onlyinherited
- placeholder ↔ String?
-
a
String
to return intoString
if thetitle
is emptyfinalread / writeinherited-setteroverride-getter -
resolver
↔ S2SingleSelectedResolver<
T> ? -
Function to resolve choice from value
covariantread / writeoverride
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- subtitle → String?
-
Returns
choice.subtitle
read-onlyinherited - title → String?
-
Returns
choice.title
read-onlyinherited -
validation
↔ S2Validation<
S2SingleChosen< ?T> > -
A function used to validate the selection
covariantfinalread / writeinherited-setteroverride-getter
- value ↔ T
-
Returns
choice.value
covariantread / writeoverride
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
has(
S2Choice< T> choice) → bool -
Returns
true
if the chosen contains the supplied choice iteminherited -
hasAll(
List< S2Choice< choices) → boolT> > -
Returns `true if the chosen has every of the supplied choice items
inherited
-
hasAny(
List< S2Choice< choices) → boolT> > -
Returns
true
if the chosen has any of the supplied choice itemsinherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resolve(
{S2SingleSelectedResolver< T> ? defaultResolver}) → void -
Resolve choice from value using user defined resolver,
or fallback to
defaultResolver
if resolver is not definedoverride -
toString(
) → String -
A string representation of this object.
override
-
toWidget(
) → Widget -
Return a Text widget from toString
inherited
-
validate(
) → void -
Validate the selection
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited