DisposableToken class
DisposableClient is used at Client
side and DisposableToken at Model
side.
- Implemented types
- Available extensions
Constructors
- DisposableToken.client({dynamic parent, VoidCallback? onCancel, VoidCallback? onFinish, VoidCallback? onDispose, dynamic data})
-
parent
- Parent object of this token.data
- Initial token data.onCancel
- Client event that is called when token is canceled.onFinish
- Client event that is called when token is finished.onDispose
- Client event that is called when token is disposed.factory
Properties
- data ↔ dynamic
-
Additional data of this token.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isActive → bool
-
Checks if cancel or dispose hasn't been executed.
no setter
- isFinished → bool
-
Checks if finish has been executed.
no setter
- onCancel ↔ VoidCallback?
-
Callback when token is canceled and
finish
called.getter/setter pairinherited - onDispose ↔ VoidCallback?
-
Callback when token is disposed and
finish
called.getter/setter pairinherited - onFinish ↔ VoidCallback?
-
Callback when token is finished and
finish
called.getter/setter pairinherited - parent → dynamic
-
Parent of this disposer.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
[bool autoDispose = true]) → void -
Cancels this token and notifies
onCancel
listener. Typically called by Client. -
dispose(
) → void - Used to clear and dispose object. Unsubscribe and close all sources. Prepare object for GC. Can be called multiple times!
-
disposeWith(
DisposeObserver observer) → void -
Available on Disposable, provided by the DisposableExt extension
Register for dispose with givenobserver
. -
finish(
[bool autoDispose = true]) → void -
Finishes this token and notifies
onFinish
listener. Typically called by API. -
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