AppStateX<T extends StatefulWidget> class abstract Get started StateX class AppStateX class

The StateX object at the 'app level.' Used to effect the whole app by being the 'root' of first State object instantiated.

dartdoc:

Inheritance

Constructors

AppStateX({StateXController? controller, List<StateXController>? controllers, Object? object, bool? notifyClientsInBuild, bool? printEvents})
Optionally supply as many State Controllers as you like to work with this App. Optionally supply a 'data object' to to be accessible to the App's InheritedWidget.

Properties

builderOverridden bool
A flag. Note if builder() function was overridden or not.
no setterinherited
buildFOverridden bool
A flag. Note if buildF() function was overridden or not.
no setterinherited
buildOverridden bool
A flag noting if the build() function was overridden or not.
no setterinherited
caughtAsyncError bool
A flag noting an Async error was caught or not
no setterinherited
context BuildContext
The location in the tree where this widget builds.
no setterinherited
controller StateXController?
Provide the 'main' controller to this 'State View.' If _controller == null, get the 'first assigned' controller if any.
no setterinherited
controllerList List<StateXController>
Supply a public list of all the Controllers.
no setterinherited
dataObject Object?
This is of type Object allowing you to propagate any class object you wish down the widget tree.
getter/setter pairinherited
deactivated bool
State object's deactivated() was called.
no setterinherited
detachedAppLifecycle bool
State object was in 'paused' state
no setterinherited
disposed bool
Flag indicating this State object is disposed. Will be garbage collected. property, mounted, is then set to false.
no setterinherited
errorMsg String
no setterinherited
errorStateName String
The name of the State object experiencing an error
no setter
exceptionMessage String
no setterinherited
firstCon StateXController?
Returns 'the first' StateXController associated with this StateX object. Returns null if empty.
no setterinherited
firstState StateX<StatefulWidget>?
Return the first State object
no setterinherited
hadSystemEvent bool
State object experienced a system event
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hiddenAppLifecycle bool
State object was in a 'hidden' state
no setterinherited
identifier String
The unique identifier for this State object.
no setterinherited
inactiveAppLifecycle bool
State object was in 'inactive' state
no setterinherited
inDebugMode bool
Determines if running in an IDE or in production. Returns true if the App is under in the Debugger and not production.
no setterinherited
inErrorRoutine bool
A flag indicating we're running in the error routine. Set to avoid infinite loop if in errors in the error routine.
no setter
isLastState bool
This is the 'latest' State being viewed by the App.
no setterinherited
lastCon StateXController?
Returns 'the last' StateXController associated with this StateX object. Returns null if empty.
no setterinherited
lastContext BuildContext?
Returns the 'latest' context in the App.
no setterinherited
lastFlutterErrorDetails FlutterErrorDetails?
Supply the last Flutter Error Details if any.
no setter
lastFlutterErrorMessage String
Return the message of th 'last' Flutter Error if any.
no setter
lastState StateX<StatefulWidget>?
Return the 'latest' State object
no setterinherited
mounted bool
Whether this State object is currently in a tree.
no setterinherited
pausedAppLifecycle bool
State object was in 'paused' state
no setterinherited
printEvents bool
Implement builder() function in your StateX class instead of build() to use the built-in FutureBuilder Widget and built-in InheritedWidget.
no setterinherited
recErrorException Object?
The Error or Exception
no setterinherited
recErrorMsg String
Simply display the exception.
no setterinherited
recHasError bool
Indicate if an exception had occurred.
no setterinherited
recStackTrace StackTrace?
The StackTrace
no setterinherited
resumedAppLifecycle bool
State object was in 'resumed' state
no setterinherited
rootCon StateXController?
Returns 'the first' StateXController associated with this StateX object. Returns null if empty.
no setterinherited
rootState AppStateX<StatefulWidget>?
Returns the 'first' StateX object in the App
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshot AsyncSnapshot<bool>?
Supply the AsyncSnapshot
no setterinherited
useInherited bool
A flag determining whether the built-in InheritedWidget is used or not.
no setterinherited
usingCupertino bool
Is the CupertinoApp being used?
no setterinherited
widget → T
You need to be able access the widget.
no setterinherited

Methods

activate() → void
Called when this object is reinserted into the tree after having been removed via deactivate.
override
add(StateXController? con) String
Collect a 'StateXController' Returns the StateXController's unique identifier.
inherited
addList(List<StateXController>? list) List<String>
Collect a list of 'Controllers'.
inherited
build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
inherited
builder(BuildContext context) Widget StateX class
Use this function instead of the build() function
inherited
buildF(BuildContext context) Widget
Implement this function instead of the build() function to utilize a built-in FutureBuilder Widget.
override
catchAsyncError(Object error) Future<bool>
Catch it if the initAsync() throws an error WITH GREAT POWER COMES GREAT RESPONSIBILITY Return true to ignore the error, false to continue the error handling
inherited
catchError(Exception? ex, {StackTrace? stack, String? library, DiagnosticsNode? context, IterableFilter<String>? stackFilter, InformationCollector? informationCollector, bool? silent}) → void
Catch and explicitly handle the error.
contains(StateXController con) bool
Returns true if found.
inherited
containsId(String? id) bool
Returns true if the specified 'StateXController' is associated with this StateX object.
inherited
containsType<T>() bool
Returns true if found
inherited
controllerById(String? id) StateXController?
Retrieve a StateXController by its a unique String identifier.
inherited
controllerByType<U extends StateXController>() → U?
Retrieve a StateXController by type.
inherited
deactivate() → void
The framework calls this method whenever it removes this StateX object from the tree. In many cases, it is about to be 'disposed of'.
override
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
dependOnInheritedWidget(BuildContext? context) bool
Set the specified widget (through its context) as a dependent of the InheritedWidget
override
detachedAppLifecycleState() → void
Calls the deactivate() and dispose() functions in all the app's StateX class objects It's success will depending on the hosting operating system: https://github.com/flutter/flutter/issues/124945#issuecomment-1514159238
override
didChangeAccessibilityFeatures() → void
Called when the system changes the set of currently active accessibility features.
override
didChangeAppLifecycleState(AppLifecycleState lifecycleState) → void
Called when the system puts the app in the background or returns the app to the foreground.
override
didChangeDependencies() → void
This method is also called immediately after initState. Otherwise called only if this State object's Widget is a dependency of InheritedWidget. When a InheritedWidget's build() function is called the dependent widget's build() function is also called but not before their didChangeDependencies() function. Subclasses rarely use this method.
inherited
didChangeLocales(List<Locale>? locales) → void
Called when the system tells the app that the user's locale has changed. For example, if the user changes the system language settings.
override
didChangeMetrics() → void
Called when the application's dimensions change. For example, when a phone is rotated.
override
didChangePlatformBrightness() → void
Called when the platform brightness changes.
override
didChangeTextScaleFactor() → void
Called when the platform's text scale factor changes.
override
didChangeViewFocus(ViewFocusEvent event) → void
Called whenever the PlatformDispatcher receives a notification that the focus state on a view has changed.
inherited
didHaveMemoryPressure() → void
Called when the system is running low on memory.
override
didPop() → void
Called when this route has been popped off.
inherited
didPopNext() → void
The top route has been popped off, and this route shows up.
inherited
didPopRoute() Future<bool>
Called when the system tells the app to pop the current route, such as after a system back button press or back gesture.
override
didPush() → void
Called when this route has been pushed.
inherited
didPushNext() → void
New route has been pushed, and this route is no longer visible.
inherited
didPushRoute(String route) Future<bool>
Called when the host tells the application to push a new route onto the navigator.
inherited
didPushRouteInformation(RouteInformation routeInformation) Future<bool>
Called when the host tells the application to push a new RouteInformation and a restoration state onto the router.
override
didRequestAppExit() Future<AppExitResponse>
Called when a request is received from the system to exit the application.
override
didUpdateController({StateXController? oldCon, StateXController? newCon}) bool
Update the 'first' controller if necessary Place in the didUpdateWidget function in the special case the StatefulWidget supplies the controller: e.g. didUpdateController(oldWidget.controller, widget.controller);
inherited
didUpdateWidget(covariant T oldWidget) → void
Override this method to respond when its StatefulWidget is re-created. The framework always calls build after calling didUpdateWidget, which means any calls to setState in didUpdateWidget are redundant.
inherited
dispose() → void
Clean up memory Called when garbage collecting
override
forEach(void func(StateXController con), {bool? reversed}) bool
To externally 'process' through the controllers. Invokes func on each StateXController possessed by this StateX object. With an option to process in reversed chronological order
inherited
forEachState(void func(StateX<StatefulWidget> state), {bool? reversed, StateX<StatefulWidget>? remove}) bool
To externally 'process' through the State objects. Invokes func on each StateX possessed by this StateX object. With an option to process in reversed chronological order
inherited
handleCancelBackGesture() → void
Called when a predictive back gesture is canceled, indicating that no navigation should occur.
inherited
handleCommitBackGesture() → void
Called when a predictive back gesture is finished successfully, indicating that the current route should be popped.
inherited
handleStartBackGesture(PredictiveBackEvent backEvent) bool
Called at the start of a predictive back gesture.
inherited
handleStatusBarTap() → void
Called when the user taps the status bar on iOS, to scroll a scroll view to the top.
inherited
handleUpdateBackGestureProgress(PredictiveBackEvent backEvent) → void
Called when a predictive back gesture moves.
inherited
hiddenAppLifecycleState() → void
All views of an application are hidden, either because the application is about to be paused (on iOS and Android), or because it has been minimized or placed on a desktop that is no longer visible (on non-web desktop), or is running in a window or tab that is no longer visible (on the web).
inherited
inactiveAppLifecycleState() → void
Apps in this state should assume that they may be pausedAppLifecycleState at any time.
inherited
initAsync() Future<bool>
Asynchronous operations must complete successfully.
inherited
initState() → void
The framework will call this method exactly once. Only when the StateX object is first created.
override
lastFlutterError([FlutterErrorDetails? details]) FlutterErrorDetails?
Record and return details of the 'last' handled error Not, simply retrieving the last error will 'clear' the storage.
listControllers(List<String?>? keys) List<StateXController?>
Returns the list of 'Controllers' but you must know their keys.
inherited
listStates(List<String> keys) List<StateX<StatefulWidget>>
Returns a List of StateX objects using unique String identifiers.
inherited
logErrorDetails(FlutterErrorDetails details) → void
Logs 'every' error as the error count is reset.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyClients() bool
Notify the InheritedWidget's dependencies
override
onAsyncError(FlutterErrorDetails details) → void
initAsync() has failed and a 'error' widget instead will be displayed. This takes in the snapshot.error details.
inherited
onError(FlutterErrorDetails details) → void
Catch any errors in the App Free for you to override
override
onSplashScreen(BuildContext context) Widget?
Supply a 'splash screen' while the FutureBuilder is processing.
inherited
onStateError(FlutterErrorDetails details) bool
Call the latest SateX object's error routine Possibly the error occurred there.
pausedAppLifecycleState() → void
The application is not currently visible to the user, not responding to user input, and running in the background.
inherited
reassemble() → void
During development, if a hot reload occurs, the reassemble method is called. This provides an opportunity to reinitialize any data that was prepared in the initState method.
inherited
recordException([Object? error, StackTrace? stack]) Object?
Return the 'last' error if any.
inherited
remove(StateXController? con) bool
Remove a 'StateXController' Returns boolean if successful.
inherited
removeByKey(String? id) bool
Remove a specific 'StateXController' by its unique 'key' identifier.
inherited
resumedAppLifecycleState() → void
The application is visible and responding to user input.
inherited
runInitAsync() bool
Call initAsync() all the time if return true. Conditional calls initAsync() creating a Future with every rebuild
inherited
setBuilder(WidgetBuilder? builder) Widget
Called when the State's InheritedWidget is called again This 'widget function' will be called again.
override
setRootStateX(StateX<StatefulWidget>? state) bool
Important to record the 'root' StateX object. Its an InheritedWidget!
inherited
setState(VoidCallback fn) → void
Calls the State object's setState() function if not (see class SetState).
override
stateById(String? id) StateX<StatefulWidget>?
Returns a StateView object using a unique String identifier.
inherited
stateByType<T extends StateX<StatefulWidget>>() → T?
Retrieve the State object by type Returns null if not found
inherited
statesById(List<String> ids) Map<String, StateX<StatefulWidget>>
Returns a Map of StateView objects using unique String identifiers.
inherited
stateSet(WidgetBuilder? builder) Widget
Called when the State's InheritedWidget is called again This 'widget function' will be called again.
override
statesList({bool? reversed, StateX<StatefulWidget>? remove}) List<StateX<StatefulWidget>>
Return a List of available StateX objects
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited
updateShouldNotify(covariant InheritedWidget oldWidget) bool
Determine if the dependencies should be updated.
inherited

Operators

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