FieldControl<T> class
- Inheritance
-
- Object
- ObservableValue<
T?> - ObservableModel<
T?> - FieldControl
- Implementers
- Available Extensions
Constructors
- FieldControl([T? value])
-
Initializes control and Stream with default
value
. -
FieldControl.of(Stream stream, {T? initValue, Function? onError, void onDone()?, bool cancelOnError = false, ValueConverter<
T> ? converter}) -
Initializes FieldControl and subscribes it to given
stream
. Check subscribeTo function for more info.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- internalData ↔ dynamic
-
getter/setter pairinherited
- isActive → bool
-
Checks if Stream is not closed.
no setteroverride
- isClosed → bool
-
Returns true if current stream is closed.
no setter
- isEmpty → bool
-
no setterinherited
- isNotEmpty → bool
-
no setterinherited
- isValid → bool
-
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sink
→ Sink<
T> -
Default sink of this controller.
Use sinkConverter to convert input data.
no setter
-
stream
→ Stream<
T?> -
no setter
- value ↔ T?
-
getter/setter pairinherited-setteroverride-getter
Methods
-
cancel(
ControlSubscription< T?> subscription) → void -
override
-
cast<
U> () → ObservableValue< U> -
inherited
-
dispose(
) → void -
Used to clear and dispose object.
After this method call is object typically unusable and ready for GC.
Can be called multiple times!
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void -
Notifies current Stream.
override
-
onFuture(
Future future, {ValueConverter? converter}) → Future -
Sets value after
future
finishes. Via ValueConverter is possible to convert object from input Stream type to own stream value. Returns Future to await and register other callbacks. -
setValue(
T? value, {bool notify = true, bool forceNotify = false}) → void -
override
-
sinkConverter(
ValueConverter< T> converter) → Sink - Returns Sink with custom ValueConverter.
-
softDispose(
) → void - Clears subscribers, but didn't close Stream entirely.
-
subscribe(
ValueCallback< T?> action, {bool current = true, dynamic args}) → FieldSubscription<T> -
override
-
subscribeStream(
void onData(T? event), {Function? onError, void onDone()?, bool cancelOnError = false, bool current = true}) → FieldSubscription< T> -
subscribeTo(
Stream stream, {Function? onError, void onDone()?, bool cancelOnError = false, ValueConverter? converter}) → FieldSubscription - Subscribes this field to given Stream. Controller will subscribe to input stream and will listen for changes and populate this changes into own stream. Via ValueConverter is possible to convert object from input Stream type to own stream value. StreamSubscription is automatically closed during dispose phase of FieldControl. Returns FieldSubscription for manual cancellation.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited