StateX<T extends StatefulWidget> class abstract

The extension of the State class. Uses the mixins: WidgetsBindingObserver, _ControllerList, _StateListeners

Inheritance
Implemented types
Mixed-in types
Implementers

Constructors

StateX([StateXController? _controller])
With an optional StateXController parameter, this constructor imposes its own Error Handler.

Properties

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 setter
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 pair
detached bool
State object was in 'paused' state
getter/setter pair
disposed bool
Flag indicating this State object is disposed. Will be garbage collected. property, mounted, is then set to false.
getter/setter pair
endState State<StatefulWidget>?
Return the 'latest' State object
no setterinherited
errorMsg String
Simply display the exception.
no setterinherited
hadSystemEvent bool
State object experienced a system event
no setter
hasError bool
Indicate if an exception had occurred.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
identifier String
The unique identifier for this State object.
no setteroverride
inactive bool
State object was in 'inactive' state
getter/setter pair
inDebugger bool
Deprecated soon. Use inDebugMode.
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 setter
lastContext BuildContext?
Returns the 'latest' context in the App.
no setterinherited
lastState State<StatefulWidget>?
no setterinherited
lastStateX StateX<StatefulWidget>?
no setterinherited
mounted bool
Whether this State object is currently in a tree.
no setterinherited
paused bool
State object was in 'paused' state
getter/setter pair
resumed bool
State object was in 'resumed' state
getter/setter pair
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
stackTrace StackTrace?
The StackTrace
no setterinherited
startState State<StatefulWidget>?
Return the first State object
no setterinherited
widget → T
You need to be able access the widget.
no setteroverride

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.
override
addAfterListener(StateListener listener) bool
Add a listener fired 'after' the main controller runs.
inherited
addBeforeListener(StateListener listener) bool
Add a listener fired 'before' the main controller runs.
inherited
addList(List<StateXController>? list) List<String>
Add a list of 'Controllers' to be associated with this StatX object.
override
addListener(StateListener listener) bool
Add a listener fired 'after' the main controller runs.
inherited
afterContains(StateListener listener) bool
Returns true of the listener specified is already added.
inherited
afterList(List<String> keys) List<StateListener>
Returns the list of 'after' listeners by matching key identifiers.
inherited
afterListener(String key) StateListener?
Returns the specified 'after' listener.
inherited
beforeContains(StateListener listener) bool
Returns true of the listener specified is already added.
inherited
beforeList(List<String> keys) List<StateListener>
Returns a List of 'before' listeners by matching key identifiers.
inherited
beforeListener(String key) StateListener?
Returns the specified 'before' listener.
inherited
build(BuildContext context) Widget
Implement the build() function if you wish Note, it's already implemented in mixin FutureBuilderStateMixin Simply explicitly implemented here to indicate the override.
override
buildF(BuildContext context) Widget
Implement this function instead of the build() function so to utilize a built-in FutureBuilder Widget and InheritedWidget. Not, it's already implemented in mixin FutureBuilderStateMixin
override
buildInherited() → void
Rebuild the InheritedWidget of the 'closes' InheritedStateX object if any.
buildWidget(BuildContext context) Widget
Deprecated soon
inherited
contains(StateXController con) bool
Returns true if the specified 'StateXController' is associated with this StateX object.
inherited
controllerById(String? keyId) StateXController?
Retrieve a StateXController by its a unique String identifier.
controllerByType<U extends StateXController>() → U?
Retrieve a StateXController by type.
copy([StateX<StatefulWidget>? state]) → void
Copy particular properties from another StateX
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
Link a widget to the InheritedWidget
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.
override
didChangeAccessibilityFeatures() → void
Called when the system changes the set of currently active accessibility features.
override
didChangeAppLifecycleState(AppLifecycleState state) → 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.
override
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.
override
didPopNext() → void
The top route has been popped off, and this route shows up.
override
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.
override
didPush() → void
Called when this route has been pushed.
override
didPushNext() → void
New route has been pushed, and this route is no longer visible.
override
didPushRoute(String route) Future<bool>
Called when the host tells the app to push a new route onto the navigator.
override
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.
inherited
didUpdateWidget(covariant StatefulWidget 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.
override
dispose() → void
The framework calls this method when this StateX object will never build again and will be disposed of with garbage collection.
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}) 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
inactiveLifecycleState() → void
Apps in this state should assume that they may be pausedLifecycleState at any time.
override
initAsync() Future<bool>
Asynchronous operations must complete successfully.
override
initState() → void
The framework will call this method exactly once. Only when the StateX object is first created.
override
listControllers(List<String> keys) List<StateXController?>
Returns the list of 'Controllers' associated with this StateX object.
inherited
listStates(List<String> keys) List<StateX<StatefulWidget>>
Returns a List of StateX objects using unique String identifiers.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyClients() → void
In harmony with Flutter's own API Rebuild the InheritedWidget of the 'closes' InheritedStateX object if any.
onAsyncError(FlutterErrorDetails details) → void
Supply an 'error handler' routine if something goes wrong in the corresponding initAsync() routine.
inherited
pausedLifecycleState() → void
The application is not currently visible to the user, not responding to user input, and running in the background.
override
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.
override
recordException([Object? error, StackTrace? stack]) Exception?
Return the 'last' error if any.
inherited
remove(StateXController? controller) String
Remove a specific StateXController to this View. Returns the StateXController's unique String identifier.
override
removeByKey(String keyId) bool
Remove a specific associated 'StateXController' from this StateX object by using its unique 'key' identifier.
inherited
removeListener(StateListener listener) bool
Removes the specified listener.
inherited
resumedLifecycleState() → void
The application is visible and responding to user input.
override
setRootStateX(StateX<StatefulWidget> state) → void
Important to record the 'root' StateX object. Its InheritedWidget!
inherited
setState(VoidCallback fn) → void
Allows 'external' routines can call this function.
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
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.
override

Operators

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