Selector<T, R> class
A specialized observable that derives its value from another observable using a selector function.
The Selector automatically updates whenever the source observable changes, but only notifies its own listeners if the selected value actually changes.
- Inheritance
-
- Object
- Observable<
R> - Selector
- Available extensions
Constructors
-
Selector.new(Observable<
T> _source, R _selector(T), {EqualityFunction<R> ? equals, ErrorCallback? onError}) - Creates a new Selector that derives its value from the source observable.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether this object has been disposed.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selector → R Function(T)
-
The selector function used to derive the value.
no setter
-
source
→ Observable<
T> -
The source observable this selector depends on.
no setter
- value ↔ R
-
value method.
getter/setter pairinherited
Methods
-
addDisposeCallback(
VoidCallback callback) → void -
Add a callback to be executed during disposal.
inherited
-
addListener(
VoidCallback listener) → void -
addListener method.
inherited
-
addSubscription(
StreamSubscription subscription) → void -
Add a stream subscription to be cancelled during disposal.
inherited
-
combineWith<
U, R> (Observable< U> other, R combiner(T, U)) → Observable<R> -
Available on Observable<
T> , provided by the ObservableSelector extension -
dispose(
) → void -
dispose method.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
) → R -
read method.
inherited
-
removeListener(
VoidCallback listener) → void -
removeListener method.
inherited
-
select<
R> (R selector(T)) → Observable< R> -
Available on Observable<
selectR> method.T> , provided by the ObservableSelector extension -
setDebounceTimer(
Timer timer) → void -
Set or update the debounce timer.
inherited
-
setValueDebounced(
R newValue, Duration delay) → void -
setValueDebounced method.
inherited
-
throwIfDisposed(
[String? operation]) → void -
Throw if this object has been disposed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateEmail(
) → Observable< String?> -
Available on Observable<
validateEmail method.String> , provided by the StringValidation extension -
validateLength(
{int? min, int? max}) → Observable< String?> -
Available on Observable<
validateLength method.String> , provided by the StringValidation extension -
watch(
) → R -
inherited
-
withSelector(
R newSelector(T)) → Selector< T, R> - Updates the selector function and recomputes the value.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited