DigiaUIAppBuilder class
A widget that handles the asynchronous initialization of the Digia UI system.
DigiaUIAppBuilder provides a builder pattern that allows you to handle different states during the initialization process (loading, ready, error). This is the recommended way to initialize Digia UI as it properly manages the async initialization flow and provides appropriate feedback to users.
The widget will:
- Show loading state while initializing
- Transition to ready state with DigiaUIApp when initialization succeeds
- Show error state if initialization fails
Example usage:
DigiaUIAppBuilder(
options: DigiaUIOptions(
accessKey: 'YOUR_ACCESS_KEY',
flavor: Flavor.production(),
),
builder: (context, status) {
if (status.isLoading) {
return LoadingScreen();
}
if (status.hasError) {
return ErrorScreen(error: status.error);
}
return MaterialApp(
home: DUIFactory().createInitialPage(),
);
},
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DigiaUIAppBuilder
Constructors
-
DigiaUIAppBuilder({Key? key, required DigiaUIOptions options, required Widget builder(BuildContext context, DigiaUIStatus status), MessageBus? messageBus, DUIAnalytics? analytics, ConfigProvider? pageConfigProvider, Map<
String, IconData> ? icons, Map<String, ImageProvider< ? images, DUIFontFactory? fontFactory, Map<Object> >String, Object?> ? environmentVariables}) -
Creates a new DigiaUIAppBuilder with the specified configuration.
const
Properties
- analytics → DUIAnalytics?
-
Optional analytics handler for tracking user interactions and events
final
- builder → Widget Function(BuildContext context, DigiaUIStatus status)
-
Builder function that receives the current initialization status
and should return appropriate widgets for each state
final
-
environmentVariables
→ Map<
String, Object?> ? -
Environment variables to make available in expressions and configurations
final
- fontFactory → DUIFontFactory?
-
Custom font factory for creating text styles with specific fonts
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
icons
→ Map<
String, IconData> ? -
Custom icon mappings to override or extend default icons
final
-
images
→ Map<
String, ImageProvider< ?Object> > -
Custom image provider mappings for app-specific images
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- messageBus → MessageBus?
-
Optional message bus for inter-component communication
final
- options → DigiaUIOptions
-
Configuration options for initializing the Digia UI system
final
- pageConfigProvider → ConfigProvider?
-
Custom page configuration provider, defaults to built-in provider if not specified
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DigiaUIAppBuilder> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
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
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → 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