BaseGetController class abstract
Basic Controller functionality for busy state management
- Inheritance
-
- Object
- GetLifeCycle
- DisposableInterface
- GetxController
- BaseGetController
- Implementers
Constructors
Properties
- anyError → dynamic
-
Returns error of any object that still have a error status.
no setter
-
busyStates
→ Map<
Object, bool> -
no setter
- disposed → bool
-
no setter
- error ↔ String?
-
Returns the error status of the Controller
getter/setter pair
-
errorStates
→ Map<
Object, dynamic> -
no setter
- hasAnyError → bool
-
Returns true if any objects still have a error status.
no setter
- hasError → bool
-
Returns the error status of the Controller
no setter
- 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 setter
- isBusy → bool
-
Returns the busy status of the Controller
no setter
- 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 setter
- listeners → int
-
no setterinherited
-
onDelete
→ InternalFinalCallback<
void> -
Internal callback that starts the cycle of this controller.
finalinherited
- onReadyCalled ↔ bool
-
getter/setter pair
-
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 pair
-
runnerMap
→ Map<
Object, FutureCallback> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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
-
busyFor(
Object key) → bool - Returns the busy status for a key if it exists. Returns false if not present
-
clearAllData(
) → bool - Clears all data and states
-
clearAllStateData(
[Object? key]) → bool - Clears all states and data by key
-
clearBusy(
) → void - Clears all the busy states
-
clearData(
[Object? key]) → bool - Clears the data by key
-
clearErrors(
) → void - Clears all the errors
-
clearStateData(
[Object? key]) → bool - Clears states and data by key
-
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 key) → String? - Returns the error by key
-
hasErrorFor(
Object key) → bool - Returns the error status by key
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyChildrens(
) → void -
inherited
-
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
-
onError(
Object? key, dynamic error) → void - Function that is called when a future throws an error
-
onInit(
) → void -
Called immediately after the widget is allocated in memory.
You might use this to initialize something for the controller.
override
-
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.
override
-
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.
-
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.
-
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.
-
runErrorFuture<
T> (Future< T?> future, {Object? key, bool throwException = false}) → Future<T?> -
runFuture<
T> (Future< T?> future, {Object? key, bool throwException = false}) → Future<T?> -
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.
-
runnerFor(
Object key) → FutureCallback? - Returns the runner by key
-
runRunner<
T> (Callback< Future< runner, {Object? key, bool throwException = false}) → Future<T?> >T?> -
setBusy(
bool value) → void - Sets the busy status for the Controller and calls notify listeners
-
setBusyFor(
Object key, bool value) → void - Sets the busy status by key and calls notify listeners
-
setDataFor(
Object key, dynamic value) → void - Sets the data by key
-
setError(
dynamic error) → void - Sets the error for the Controller
-
setErrorFor(
Object key, dynamic value) → void - Sets the error state for the key equal to the value passed in and notifies Listeners
-
setRunner(
FutureCallback runner) → void - Sets the runner for the Controller
-
setRunnerFor(
Object key, FutureCallback value) → void - Sets the runner by key
-
setupStream<
T> (Stream< T> stream, {dynamic onData, dynamic onSubscribed, dynamic onError, dynamic onCancel, dynamic transformData}) → StreamData -
toString(
) → String -
A string representation of this object.
inherited
-
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.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited