GetController class abstract
Multi purpose Controller implementation of GetxController
- Inheritance
Constructors
Properties
- actionError ↔ String?
-
Returns the error status of an action
getter/setter pair
- actionName → String
-
final
- actionRunner ↔ FutureCallback?
-
Returns the runner of the action
getter/setter pair
- actionStatus → GetStatus?
-
Returns the GetStatus of action
no setter
- actionSuccess → String?
-
Returns the success status of an action
no setter
- anyError → dynamic
-
Returns error of any object that still have a error status.
no setterinherited
- anyNotSucceeded → GetResult
-
Returns result for any object which did not succeed.
no setter
-
busyStates
→ Map<
Object, bool> -
no setterinherited
- changeSource ↔ bool
-
getter/setter pairinherited
-
dataMap
→ Map<
Object, dynamic> -
no setterinherited
- disposed → bool
-
no setterinherited
- error ↔ String?
-
Returns the error status of the Controller
getter/setter pairinherited
-
errorStates
→ Map<
Object, dynamic> -
no setterinherited
-
futuresMap
→ Map<
Object, FutureCallback> -
no setterinherited
-
futuresToRun
→ Map<
Object, FutureCallback> -
Multiple futures to run at the startup
no setterinherited
- hasActionError → bool
-
Returns the error status of action
no setter
- 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
- isActionBusy → bool
-
Returns the status of action if busy or not
no setter
- isActionBusyOrFailed → bool
-
Returns the status of action if busy/failed or not
no setter
- isActionBusyOrSucceeded → bool
-
Returns the status of action if busy/succeeded or not
no setter
- isActionDataReady → bool
-
Returns the data ready status of the action if no error occurred
no setter
- isActionFailed → bool
-
Returns the status of action if failed or not
no setter
- isActionReady → bool
-
Returns the data ready status of the action even if error occurred
no setter
- isActionStarted → bool
-
Returns the status of the action if started or not
no setter
- isActionSucceeded → bool
-
Returns the status of action if succeeded or not
no setter
- isAllSucceeded → bool
-
Returns true if all objects have succeeded.
no setter
- 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
- isBusyOrSucceeded → bool
-
Returns the status of Controller if busy/succeeded or not
no setter
- isClosed → bool
-
Checks whether the controller has already been closed.
no setterinherited
- isDataReady → bool
-
Returns the data ready status of the Controller if no error occurred
no setterinherited
- isFailed → bool
-
Returns the status of Controller if failed or not
no setter
- isInitialised → bool
-
Returns the initialisation status of the Controller when all futures are completed
no setterinherited
- isReady → bool
-
Returns the ready status of the Controller even if error occurred
no setterinherited
- isStarted → bool
-
Returns the status of the Controller if started or not
no setter
- isSucceeded → bool
-
Returns the status of Controller if succeeded or not
no setter
- listeners → int
-
no setterinherited
- loadPrefsOnInit → bool
-
To mark, if prefs should be reloaded beforeInit. Defaults to true.
no setter
-
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
- status → GetStatus?
-
Returns the GetStatus of the Controller
no setter
- success → String?
-
Returns the success message of the Controller
no setter
-
webAPIs
→ List<
GetWebAPI> -
Include all web APIs for cleanup when closed
no setter
Methods
-
$configureLifeCycle(
) → void -
inherited
-
actionResult<
T> () → GetResult< T> ? - Returns the data of the action
-
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
-
busyOrFailed(
dynamic key) → bool - Returns the status by key if busy/failed or not
-
busyOrSucceeded(
dynamic key) → bool - Returns the status by key if busy/succeeded or not
-
cancelAction(
) → void - Cancels the action and clear the associated data
-
cancelFuture(
[dynamic key]) → void - Cancels the future by key and clear the associated data
-
clearAction(
) → void - Clears the action data
-
clearAllData(
) → bool -
Clears all data and states
inherited
-
clearAllStateData(
[Object? key]) → bool -
Clears all states but 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
-
data<
T> () → T? -
Returns the data of the Controller
inherited
-
dataFor<
T> (Object key) → T? -
Returns the data by key
inherited
-
dataReady(
Object key) → bool -
Returns the data ready status by key if no error occurred
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 key) → String? -
Returns the error by key
inherited
-
failed(
dynamic key) → bool - Returns the status by key if failed or not
-
futureToRun(
) → Future -
Single future to run at the startup
inherited
-
hasErrorFor(
Object key) → bool -
Returns the error status by key
inherited
-
hasErrorOr(
[bool? condition]) → bool -
Returns the error status of the Controller and checks if condition valid
inherited
-
initialise(
) → Future -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyChildrens(
) → void -
inherited
-
notifySourceChanged(
{bool clearOldData = false}) → 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
-
onData(
Object key) → void -
Called when any future gets completed
inherited
-
onDataReady(
) → void -
Called when all initialization futures are completed
inherited
-
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
-
ready(
Object key) → bool - Returns the data ready status by key even if error occurred
-
refresh(
) → void -
inherited
-
refreshData(
) → Future -
Run the futures again and refresh
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
-
result<
T> () → GetResult< T> ? - Returns the data of the Controller
-
resultFor<
T> ([Object? key]) → GetResult< T> ? - Returns the result data by key
-
runAction<
T> (Callback< Future< action, {bool throwException = false}) → Future<T?> >T?> -
runActionFuture<
T> (Future< T?> future, {bool throwException = false}) → Future<T?> - Sets the action to busy, runs the action and then sets it to not busy when completed.
-
runActionFutures<
T> (List< Future> futures) → Future<bool> - Sets the action to busy, runs all the actions and then sets it to not busy when completed.
-
runActionRunner<
T> (Callback< Future< runner, {bool throwException = false}) → Future<T?> >T?> - Sets the action to busy, runs the action and then sets it to not busy when completed.
-
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.
override
-
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?> -
override
-
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
-
setActionResult(
dynamic value) → void - Sets the data of the action
-
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
-
setData(
dynamic data) → void -
Sets the data for the Controller
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
-
setResult(
dynamic value) → void - Sets the data of the Controller
-
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
-
started(
dynamic key) → bool - Returns the status by key if started or not
-
statusFor(
dynamic key) → GetStatus? - Returns the GetStatus by key
-
succeeded(
dynamic key) → bool - Returns the status by key if succeeded or not
-
successFor(
Object key) → String? - Returns the success message by key
-
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.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited