ControlRootScope class

Holds appKey and rootKey, this keys are pointing to WidgetsApp and ControlRoot Widgets. Also holds current root context. This context can be changed within Widget Tree, but it's highly recommended to point this context to any top level Widget.

Constructors

ControlRootScope.main()
Gives access to global variables like appKey and rootKey. Also global root context is accessible via this object.
const

Properties

context BuildContext?
Returns current root context. Default context set by framework don't have access to Scaffold. This context is also changed when AppState is changed.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
Checks if ControlRoot is initialized and root BuildContext is available.
no setter
rootKey GlobalKey<ControlRootState>
Key of ControlRoot Widget. Set by framework.
no setter
rootState ControlRootState?
Returns ControlRootState of ControlRoot Widget if is initialized.
no setter
rootWidget ControlRoot?
Returns ControlRoot Widget if is initialized.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setup ControlRootSetup?
Returns current ControlRootSetup of ControlRoot.
no setter
state AppState?
Returns current AppState of ControlRoot.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyControlState([ControlArgs? args]) bool
Notifies state of ControlRoot. To change AppState use setAppState.
setAppState(AppState? state, {dynamic args, bool clearNavigator = true}) bool
Notifies state of ControlRoot and sets new AppState.
setAuthState({dynamic args, bool clearNavigator = true}) bool
Changes AppState to AppState.auth
setBackgroundState({dynamic args, bool clearNavigator = true}) bool
Changes AppState to AppState.background
setInitState({dynamic args, bool clearNavigator = true}) bool
Changes AppState to AppState.init
setMainState({dynamic args, bool clearNavigator = true}) bool
Changes AppState to AppState.main
setOnboardingState({dynamic args, bool clearNavigator = true}) bool
Changes AppState to AppState.onboarding
toString() String
A string representation of this object.
inherited

Operators

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