StreamGetController<T> class
abstract
- Inheritance
-
- Object
- GetLifeCycle
- DisposableInterface
- GetxController
- BaseGetController
- DynamicSourceGetController
- StreamGetController
- Implemented types
Constructors
Properties
- anyError → dynamic
-
Returns error of any object that still have a error status.
no setterinherited
-
busyStates
→ Map<
Object, bool> -
no setterinherited
- changeSource ↔ bool
-
getter/setter pairinherited
- data → T?
-
no setterinherited
- dataReady → bool
-
no setterinherited
- disposed → bool
-
no setterinherited
- error ↔ String?
-
Returns the error status of the Controller
getter/setter pairinherited
-
errorStates
→ Map<
Object, dynamic> -
no setterinherited
- hasAnyError → bool
-
Returns true if any objects still have a error status.
no setterinherited
- hasError → bool
-
Returns the error status of the Controller
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
no setterinherited
- initialized → bool
-
Checks whether the controller has already been initialized.
no setterinherited
- isAnyBusy → bool
-
Returns true if any objects still have a busy status that is true.
no setterinherited
- isBusy → bool
-
Returns the busy status of the Controller
no setterinherited
- isClosed → bool
-
Checks whether the controller has already been closed.
no setterinherited
- isInitialised → bool
-
Returns the initialisation status of the Controller when all futures are completed
no setterinherited
- listeners → int
-
no setterinherited
-
onDelete
→ InternalFinalCallback<
void> -
Internal callback that starts the cycle of this controller.
finalinherited
- onReadyCalled ↔ bool
-
getter/setter pairinherited
-
onStart
→ InternalFinalCallback<
void> -
Called at the exact moment the widget is allocated in memory.
It uses an internal "callable" type, to avoid any @overrides in subclases.
This method should be internal and is required to define the
lifetime cycle of the subclass.
finalinherited
- runner ↔ FutureCallback?
-
Returns the runner of the Controller
getter/setter pairinherited
-
runnerMap
→ Map<
Object, FutureCallback> -
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
T> -
Stream to listen to
no setter
- streamSubscription → StreamSubscription?
-
no setter
Methods
-
$configureLifeCycle(
) → void -
inherited
-
addListener(
GetStateUpdate listener) → Disposer -
Register a closure to be called when the object notifies its listeners.
inherited
-
addListenerId(
Object? key, GetStateUpdate listener) → Disposer -
inherited
-
beforeInit(
) → Future -
override
-
busyFor(
Object key) → bool -
Returns the busy status for a key if it exists.
Returns false if not present
inherited
-
clearAllData(
) → bool -
Clears all data and states
inherited
-
clearAllStateData(
[Object? key]) → bool -
Clears all states and data by key
inherited
-
clearBusy(
) → void -
Clears all the busy states
inherited
-
clearData(
[Object? key]) → bool -
Clears the data by key
inherited
-
clearErrors(
) → void -
Clears all the errors
inherited
-
clearStateData(
[Object? key]) → bool -
Clears states and data by key
inherited
-
dispose(
) → void -
inherited
-
disposeId(
Object id) → void -
To dispose an
id
from future updates(), this ids are registered byGetBuilder()
or similar, so is a way to unlink the state change with the Widget from the Controller.inherited -
errorFor(
[Object? object]) → String? -
Returns the error by key
inherited
-
hasErrorFor(
Object key) → bool -
Returns the error status by key
inherited
-
initialise(
) → Future -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyChildrens(
) → void -
inherited
-
notifySourceChanged(
{bool clearOldData = false}) → void -
override
-
onCancel(
) → void -
onClose(
) → void -
Called before onDelete method. onClose might be used to
dispose resources used by the controller. Like closing events,
or streams before the controller is destroyed.
Or dispose objects that can potentially create some memory leaks,
like TextEditingControllers, AnimationControllers.
Might be useful as well to persist some data on disk.
override
-
onData(
T? data) → void - Called before the notifyListeners is called when data has been set
-
onError(
Object? key, dynamic error) → void -
Function that is called when a future throws an error
inherited
-
onInit(
) → void -
Called immediately after the widget is allocated in memory.
You might use this to initialize something for the controller.
inherited
-
onReady(
) → void -
Called 1 frame after onInit(). It is the perfect place to enter
navigation events, like snackbar, dialogs, or a new route, or
async request.
inherited
-
onSubscribed(
) → void - Called when the stream is listened too
-
refresh(
) → void -
inherited
-
refreshGroup(
Object id) → void -
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
-
removeListenerId(
Object id, VoidCallback listener) → void -
inherited
-
runBusyFuture<
T> (Future< T?> future, {Object? key, bool throwException = false}) → Future<T?> -
Sets the Controller to busy, runs the future and then sets it
to not busy when complete.
inherited
-
runBusyFutures(
List< Future> futures, {Object? key}) → Future<bool> -
Sets the Controller to busy, runs the futures and then sets it
to not busy when complete.
inherited
-
runBusyRunner<
T> (Callback< Future< runner, {Object? key, bool throwException = false}) → Future<T?> >T?> -
Sets the key to busy, runs the runner and then sets it to not busy
when completed.
inherited
-
runErrorFuture<
T> (Future< T?> future, {Object? key, bool throwException = false}) → Future<T?> -
inherited
-
runFuture<
T> (Future< T?> future, {Object? key, bool throwException = false}) → Future<T?> -
inherited
-
runFutureQueue<
T> (Callback< Future< callback, {Object? key, bool throwException = false}) → Future<T?> >T?> -
Sets the key for error logs, runs the future in queue which means next
future will not run unless the previous gets completed.
inherited
-
runnerFor(
Object key) → FutureCallback? -
Returns the runner by key
inherited
-
runRunner<
T> (Callback< Future< runner, {Object? key, bool throwException = false}) → Future<T?> >T?> -
inherited
-
setBusy(
bool value) → void -
Sets the busy status for the Controller and calls notify listeners
inherited
-
setBusyFor(
Object key, bool value) → void -
Sets the busy status by key and calls notify listeners
inherited
-
setDataFor(
Object key, dynamic value) → void -
Sets the data by key
inherited
-
setError(
dynamic error) → void -
Sets the error for the Controller
inherited
-
setErrorFor(
Object key, dynamic value) → void -
Sets the error state for the key equal to the value passed in and notifies Listeners
inherited
-
setRunner(
FutureCallback runner) → void -
Sets the runner for the Controller
inherited
-
setRunnerFor(
Object key, FutureCallback value) → void -
Sets the runner by key
inherited
-
setupStream<
T> (Stream< T> stream, {dynamic onData, dynamic onSubscribed, dynamic onError, dynamic onCancel, dynamic transformData}) → StreamData -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transformData(
T data) → T - Called before the data is set for the Controller
-
update(
[List< Object> ? ids, bool condition = true]) → void -
Rebuilds
GetBuilder
each time you callupdate()
; Can take a List ofids
, that will only update the matchingGetBuilder( id: )
,ids
can be reused amongGetBuilders
like group tags. The update will only notify the Widgets, ifcondition
is true.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited