Commission<T> class

This class inherit from Computed and provide a function to set property 'value'

Inheritance
Mixed in types

Constructors

Commission({required T reader(), required void writer(T val), Validator? validator})
Create a computed can writeable

Properties

calculator FutureOr<T> Function()
Function used to calculate value
finalinherited
dependCount int
Number of observable which this object depend on
no setterinherited
error String?
Error message if value invalid, otherwise is null
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListener bool
Check there are listeners on this observable
no setterinherited
hasValidator bool
Check has using validate value
no setterinherited
isPaused bool
Current status rebuild value is pause or not
no setterinherited
modified bool
Check value has updated
no setterinherited
oldValue → T
The old value if has change
no setterinherited
onError → (void Function(Object error, StackTrace stack)?)
Function called if there are error in procession calculator
finalinherited
peek → T
The current value but ignore check depend on in Computed context
no setterinherited
rateLimit int
Only notify change and rebuild after a number period (millisecond)
getter/setter pairinherited
reader → T Function()
Function used to compute value
final
rebuildCount int
Number times of calculator was called
no setterinherited
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 setterinherited
subcriptions List<Subscription>
The current subscription listen on to update computed
no setterinherited
valid bool
Validate status
no setterinherited
validStatus ValidateStatus
Get current status of validating process
no setterinherited
value ↔ T
The current value, if value called in a computed context, it will set Computed is depend on this
getter/setter pairinherited-getteroverride-setter
writer → void Function(T val)
Function used to update value
final

Methods

call() → T
inherited
changed(Function callback) Subscription
Listen on value changed then run callback
inherited
dispose() → void
Remember close a computed if you don't need it to avoid it auto rebuild
inherited
listen(Function callback) Subscription
Listen on value changed then run callback, it also run callback in first time
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notify() → void
Notify to observers are listen on this observable
inherited
pause() → void
Temporary pause rebuild value if there are an observable changed
inherited
resume() → void
Resume and rebuild value after paused
inherited
setError(String? msg) → void
Manual set error, used to update error message by validate outsite
inherited
toString() String
A string representation of this object.
inherited

Operators

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