Selector0<T> class
A base class for custom Selector.
It works with any InheritedComponent
. Variants like Selector and
Selector6 are just syntax sugar to use Selector0 with Provider.of.
But it will not work with values
coming from anything but InheritedComponent
.
As such, the following:
T value;
return Selector0(
selector: (_) => value,
builder: ...,
)
will still call builder
again, even if value
didn't change.
Constructors
-
Selector0({Key? key, required ValueComponentBuilder<
T> builder, required T selector(BuildContext), ShouldRebuild<T> ? shouldRebuild, Component? child}) -
Both
builder
andselector
must not benull
.
Properties
-
builder
→ ValueComponentBuilder<
T> -
A function that builds a component tree from
child
and the last result of selector.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one component replaces another component in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selector → T Function(BuildContext)
-
A function that obtains some
InheritedComponent
and map their content into a new object with only a limited number of properties.final
Methods
-
createElement(
) → SingleChildStatefulElement -
Creates a
StatefulElement
to manage this component's location in the tree.inherited -
createState(
) → _Selector0State< T> - Creates the mutable state for this component at a given location in the tree.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited