ObservableBase<T> class abstract

A base class for observable should has value and can notify to observers

Implementers

Constructors

ObservableBase(Validator? _validator)
Create an observable with validator

Properties

error String?
Error message if value invalid, otherwise is null
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListener bool
Check there are listeners on this observable
no setter
hasValidator bool
Check has using validate value
no setter
modified bool
Check value has updated
no setter
oldValue → T
The old value if has change
no setter
peek → T
The current value but ignore check depend on in Computed context
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<T>
Create a broadcast stream to listen value changes.
no setter
valid bool
Validate status
no setter
validStatus ValidateStatus
Get current status of validating process
no setter
value → T
The current value, if value called in a computed context, it will set Computed is depend on this
no setter

Methods

call() → T
changed(Function callback) Subscription
Listen on value changed then run callback
dispose() → void
Close stream (if used) and all listeners on this observable
listen(Function callback) Subscription
Listen on value changed then run callback, it also run callback in first time
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify() → void
Notify to observers are listen on this observable
setError(String? msg) → void
Manual set error, used to update error message by validate outsite
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited