StateX<T extends StatefulWidget> class Get started StateX class Testing

The extension of the State class.

dartdoc:

Inheritance
Implemented types
Mixed-in types
Implementers

Constructors

StateX({StateXController? controller, bool? runAsync, bool? useInherited, bool? routeAware})
Default useInherited to false

Properties

builderOverridden bool
A flag. Note if builder() function was overridden or not.
no setterinherited
buildFOverridden bool
A flag. Note if build() function was overridden or not.
no setterinherited
buildInOverridden bool
A flag. Note if buildIn() function was overridden or not.
no setterinherited
buildOverridden bool
A flag noting if the build() function was overridden 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>
List 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.
getter/setter pairinherited
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.
getter/setter pairinherited
endState → StateX<StatefulWidget>?
Return the 'latest' State object
no setterinherited
errorMsg String
Simply display the exception.
no setterinherited
firstCon → StateXController?
Returns 'the first' StateXController associated with this StateX object. Returns null if empty.
no setterinherited
firstState → StateX<StatefulWidget>?
no setterinherited
hadSystemEvent bool
State object experienced a system event
no setterinherited
hasError bool
Indicate if an exception had occurred.
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
isEndState bool
This is the 'latest' State being viewed by the App.
no setterinherited
isLastState bool
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
lastState → StateX<StatefulWidget>?
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
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
routeAware bool
A flag.Is this State aware of changes in route or not.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshot AsyncSnapshot<bool>?
Supply the AsyncSnapshot
no setterinherited
stackTrace StackTrace?
The StackTrace
no setterinherited
startState → StateX<StatefulWidget>?
Return the first State object
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? controller) String
Add a specific StateXController to this View. Returns the StateXController's unique String identifier.
inherited
addList(List<StateXController>? list) List<String>
Add a list of 'Controllers' to be associated with this StatX object.
inherited
build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
inherited
buildAndroid(BuildContext context) Widget
This is an optional function allowing you to make the distinction. Build the Android interface. By convention, this involves Material Interface
builder(BuildContext context) Widget
This function is wrapped in a Builder widget. If you don't use it, use the buildAndroid() or buildiOS() function.
override
buildF(BuildContext context) Widget
dartdoc: {@category StateX class}
inherited
buildIn(BuildContext context) Widget
inherited
buildiOS(BuildContext context) Widget
This is an optional function allowing you to make the distinction. Build the iOS interface. By convention, this involves Cupertino Interface Defaults to the Material interface design if called yet not implemented
canPop() bool
Whether the navigator can be popped.
inherited
contains(StateXController con) bool
Returns true if found.
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
copy([StateX<StatefulWidget>? state]) → void
Copy particular properties from another StateX
inherited
deactivate() → void
The framework calls this method whenever it removes this State object from the tree.
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
inherited
detachedAppLifecycleState() → void
inherited
detachedLifecycleState() → void
Either be in the progress of attaching when the engine is first initializing or after the view being destroyed due to a Navigator pop.
inherited
didChangeAccessibilityFeatures() → void
Called when the system changes the set of currently active accessibility features.
inherited
didChangeAppLifecycleState(AppLifecycleState state) → void
Called when the system puts the app in the background or returns the app to the foreground.
inherited
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.
inherited
didChangeMetrics() → void
Called when the application's dimensions change. For example, when a phone is rotated.
inherited
didChangePlatformBrightness() → void
Called when the platform brightness changes.
inherited
didChangeTextScaleFactor() → void
Called when the platform's text scale factor changes.
inherited
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.
inherited
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
didPopOff() → void
Called when the State's current route has been popped off.
inherited
didPopRoute() Future<bool>
Called when the system tells the app to pop the current route. For example, on Android, this is called when the user presses the back button. Observers are notified in registration order until one returns true. If none return true, the application quits.
inherited
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 app 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.
inherited
didRequestAppExit() Future<AppExitResponse>
Called when a request is received from the system to exit the application.
inherited
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
Called when this object is removed from the tree permanently.
inherited
finalizeRoute(Route route) → void
Complete the lifecycle for a route that has been popped off the navigator.
inherited
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
handleUpdateBackGestureProgress(PredictiveBackEvent backEvent) → void
Called when a predictive back gesture moves.
inherited
hiddenAppLifecycleState() → void
inherited
hiddenLifecycleState() → 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
inherited
inactiveLifecycleState() → void
Apps in this state should assume that they may be pausedLifecycleState 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
listControllers(List<String?>? ids) 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
maybePop<T extends Object?>([T? result]) Future<bool>
Consults the current route's Route.popDisposition method, and acts accordingly, potentially popping the route as a result; returns whether the pop request should be considered handled.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyClients() bool
In harmony with Flutter's own API there's also a notifyClients() function Rebuild the InheritedWidget of the 'closes' InheritedStateX object if any.
inherited
onAsyncError(FlutterErrorDetails details) → void
Supply an 'error handler' routine if something goes wrong in the corresponding runAsync() or initAsync() routine.
inherited
onError(FlutterErrorDetails details) → void
Offer an error handler
inherited
onSplashScreen(BuildContext context) Widget?
Supply a 'splash screen' while the FutureBuilder is processing.
inherited
pausedAppLifecycleState() → void
inherited
pausedLifecycleState() → void
The application is not currently visible to the user, not responding to user input, and running in the background.
inherited
pop<T extends Object?>([T? result]) → void
Pop the top-most route off the navigator.
inherited
popAndPushNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) Future<T?>
Pop the current route off the navigator and push a named route in its place.
inherited
popUntil(RoutePredicate predicate) → void
Calls pop repeatedly until the predicate returns true.
inherited
push<T extends Object?>(Route<T> route) Future<T?>
Push the given route onto the navigator.
inherited
pushAndRemoveUntil<T extends Object?>(Route<T> newRoute, RoutePredicate predicate) Future<T?>
Push the given route onto the navigator, and then remove all the previous routes until the predicate returns true.
inherited
pushNamed<T extends Object?>(String routeName, {Object? arguments}) Future<T?>
Push a named route onto the navigator.
inherited
pushNamedAndRemoveUntil<T extends Object?>(String newRouteName, RoutePredicate predicate, {Object? arguments}) Future<T?>
Push the route with the given name onto the navigator, and then remove all the previous routes until the predicate returns true.
inherited
pushReplacement<T extends Object?, TO extends Object?>(Route<T> newRoute, {TO? result}) Future<T?>
Replace the current route of the navigator by pushing the given route and then disposing the previous route once the new route has finished animating in.
inherited
pushReplacementNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) Future<T?>
Replace the current route of the navigator by pushing the route named routeName and then disposing the previous route once the new route has finished animating in.
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]) Exception?
Return the 'last' error if any.
inherited
remove(StateXController? controller) bool
Remove a specific StateXController to this View. Returns the StateXController's unique String identifier.
inherited
removeByKey(String? id) bool
Remove a specific 'StateXController' by its unique 'key' identifier.
inherited
removeRoute(Route route) → void
Immediately remove route from the navigator, and Route.dispose it.
inherited
removeRouteBelow(Route anchorRoute) → void
Immediately remove a route from the navigator, and Route.dispose it. The route to be removed is the one below the given anchorRoute.
inherited
replace<T extends Object?>({required Route oldRoute, required Route<T> newRoute}) → void
Replaces a route on the navigator that most tightly encloses the given context with a new route.
inherited
replaceRouteBelow<T extends Object?>({required Route anchorRoute, required Route<T> newRoute}) → void
Replaces a route on the navigator with a new route. The route to be replaced is the one below the given anchorRoute.
inherited
restorablePopAndPushNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) String
Pop the current route off the navigator and push a named route in its place.
inherited
restorablePush<T extends Object?>(RestorableRouteBuilder<T> routeBuilder, {Object? arguments}) String
Push a new route onto the navigator.
inherited
restorablePushAndRemoveUntil<T extends Object?>(RestorableRouteBuilder<T> newRouteBuilder, RoutePredicate predicate, {Object? arguments}) String
Push a new route onto the navigator, and then remove all the previous routes until the predicate returns true.
inherited
restorablePushNamed<T extends Object?>(String routeName, {Object? arguments}) String
Push a named route onto the navigator.
inherited
restorablePushNamedAndRemoveUntil<T extends Object?>(String newRouteName, RoutePredicate predicate, {Object? arguments}) String
Push the route with the given name onto the navigator that most tightly encloses the given context, and then remove all the previous routes until the predicate returns true.
inherited
restorablePushReplacement<T extends Object?, TO extends Object?>(RestorableRouteBuilder<T> routeBuilder, {TO? result, Object? arguments}) String
Replace the current route of the navigator by pushing a new route and then disposing the previous route once the new route has finished animating in.
inherited
restorablePushReplacementNamed<T extends Object?, TO extends Object?>(String routeName, {TO? result, Object? arguments}) String
Replace the current route of the navigator that most tightly encloses the given context by pushing the route named routeName and then disposing the previous route once the new route has finished animating in.
inherited
restorableReplace<T extends Object?>({required Route oldRoute, required RestorableRouteBuilder<T> newRouteBuilder, Object? arguments}) String
Replaces a route on the navigator that most tightly encloses the given context with a new route.
inherited
restorableReplaceRouteBelow<T extends Object?>({required Route anchorRoute, required RestorableRouteBuilder<T> newRouteBuilder, Object? arguments}) String
Replaces a route on the navigator with a new route. The route to be replaced is the one below the given anchorRoute.
inherited
resumedAppLifecycleState() → void
inherited
resumedLifecycleState() → void
The application is visible and responding to user input.
inherited
runAsync() Future<bool>
Run the StateX object's initAsync() function Override this function to repeatedly run initAsync()
inherited
setRootStateX(StateX<StatefulWidget> state) bool
Important to record the 'root' StateX object. Its an InheritedWidget!
inherited
setState(VoidCallback fn) → void
Allows 'external' routines to call this function.
inherited
state(WidgetBuilder? widgetFunc) Widget
inherited
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? widgetFunc) Widget
Called when the State's InheritedWidget is called again This 'widget function' will be called again.
inherited
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
updateNewStateX(covariant StateX<StatefulWidget> oldState) → void
Update the 'new' StateX object from the 'old' StateX object. Returning to this app from another app will re-create the State object You 'update' the current State object using this function.
inherited
updateShouldNotify(covariant InheritedWidget oldWidget) bool
Determine if the dependencies should be updated.
inherited
watch<T>(T? obj) Rx<T>
inherited

Operators

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

Static Properties

router NavigatorState
Use this to navigate throughout the your app
no setter