UIStateWorkflow class
Widget which encapsulates all relevant information for ui state workflow.
This widget should be wrapped around a Router or MaterialApp, which can
then be created within the UIStateWorkflow.builder
method in the
constructor. The UIStateWorkflow instance passed to the method provides
access to the the RouteInformationParser an RouterDelegate instance
specific to the workflow, which should be used in the routing class, to
enable tthe full capacity of the workflow engine.
Example:
Widget build(BuildContext context) {
final loginState = LoginState();
final rolesState = RolesState();
return MultiProvider(
providers: [
ChangeNotifierProvider.value(value: loginState),
ChangeNotifierProvider.value(value: rolesState)
],
child: UIStateWorkflow(
managerFactory: _managerFactory,
pageSelector: _pageSelector,
valueProviders: {loginState, rolesState},
enableLocations: false,
useFullLocations: false,
builder: (context, wfContext) {
return MaterialApp.router(
routeInformationParser: wfContext.informationParser,
routerDelegate: wfContext.routerDelegate,
);
},
),
);
}
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- UIStateWorkflow
Constructors
-
UIStateWorkflow({required UIStateManager managerFactory(ProviderContext context), required UIStatePage pageSelector(PageConfiguration? config), required Widget builder(BuildContext context, WorkflowContext wfContext), Set<
Listenable> valueProviders = const {}, bool changeHandler(ProviderContext context)?, bool enableLocations = false, bool useFullLocations = false, LocationConverter? locationConverter}) - Creates an instance of UIStateWorkflow.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- workflowContext → WorkflowContext
-
Getter for the workflow context.
no setter
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
goToState(
String stateId) → void - Tries to make the transition to the state with the specified id.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refresh(
) → void - Refreshes the workflow state.
-
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
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
of(
BuildContext context) → UIStateWorkflow - Returns the nearest UIStateWorkflow instance in the UI tree.