### Initialization Guide Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/SUMMARY.txt Guide on how to initialize the Digia UI SDK, including different setup flavors. ```APIDOC ## Initialization ### Description This section covers the SDK setup process and available flavors for initialization. ### Endpoint N/A (SDK Initialization) ### Usage Refer to the `initialization.md` document for detailed instructions. ``` -------------------------------- ### Custom NetworkConfiguration Example Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/configuration.md An example demonstrating how to configure DigiaUIOptions with custom network settings, including extended timeouts and redirect behavior. ```dart final options = DigiaUIOptions( accessKey: 'YOUR_KEY', flavor: Flavor.release(...), networkConfiguration: NetworkConfiguration( connectTimeout: Duration(seconds: 60), receiveTimeout: Duration(seconds: 60), sendTimeout: Duration(seconds: 60), maxRedirects: 10, followRedirects: true, ), ); ``` -------------------------------- ### UI Factory Guide Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/SUMMARY.txt Guide to the UI Factory for creating pages, components, and widgets. ```APIDOC ## UI Factory ### Description This guide explains how to use the UI Factory to manage and create pages, components, and widgets within the Digia UI SDK. ### Endpoint N/A (SDK Feature) ### Usage Refer to the `ui-factory.md` document for comprehensive usage instructions. ``` -------------------------------- ### Instantiate LocalFirstStrategy Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/initialization.md Example of how to create an instance of LocalFirstStrategy. ```dart final strategy = LocalFirstStrategy(); ``` -------------------------------- ### Automatic Setup with DigiaUIApp Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/digia-ui-scope.md Demonstrates the automatic setup of DigiaUIScope when using the DigiaUIApp widget, providing necessary handlers and message bus. ```dart DigiaUIApp( digiaUI: digiaUI, analyticsHandler: myAnalyticsHandler, messageBus: messageBus, builder: (context) => MaterialApp( // Inside this tree, DigiaUIScope.of(context) will work home: MyHomePage(), ), ) ``` -------------------------------- ### Creating and Registering Custom Virtual Widgets Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/pages-and-components.md Example demonstrating how to create a custom VirtualWidget and register it with the DUIFactory. ```APIDOC ### Creating Custom Virtual Widgets ```dart class MyCustomWidget extends VirtualWidget { final MyProps props; MyCustomWidget({ required this.props, String? refName, VirtualWidget? parent, }) : super(refName: refName, parent: parent); @override Widget render(RenderPayload payload) { return Container( color: props.backgroundColor, child: Text(props.title), ); } } // Register the widget DUIFactory().registerWidget( 'custom/myWidget', (json) => MyProps.fromJson(json), (props, childGroups) => MyCustomWidget(props: props), ); ``` ``` -------------------------------- ### Instantiate CacheFirstStrategy Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/initialization.md Example of how to create an instance of CacheFirstStrategy. ```dart final strategy = CacheFirstStrategy(); ``` -------------------------------- ### DigiaUIAppBuilder Initialization Example Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/digia-ui-app.md An example demonstrating how to use DigiaUIAppBuilder in a Flutter application. It shows how to configure options and handle different initialization states (loading, error, ready) within the builder function. ```dart void main() { runApp( DigiaUIAppBuilder( options: DigiaUIOptions( accessKey: 'YOUR_ACCESS_KEY', flavor: Flavor.release( initStrategy: NetworkFirstStrategy(timeoutInMs: 2000), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ), ), builder: (context, status) { if (status.isLoading) { return MaterialApp( home: Scaffold( body: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ CircularProgressIndicator(), SizedBox(height: 16), Text('Loading latest content...'), if (status.hasCache) TextButton( onPressed: () => status.useCachedVersion(), child: Text('Use Offline Version'), ), ], ), ), ); } if (status.hasError) { return MaterialApp( home: Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(Icons.error_outline, size: 48), SizedBox(height: 16), Text('Failed to load content'), Text('Error: ${status.error}'), if (status.hasCache) ElevatedButton( onPressed: () => status.useCachedVersion(), child: Text('Use Cached Version'), ), ], ), ), ), ); } return MaterialApp( home: DUIFactory().createInitialPage(), ); }, ), ); } ``` -------------------------------- ### Expression Binding Examples Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/lib/context.md Examples of dynamic expression binding for text content, visibility, and tap actions within JSON configurations. ```json { "text": "${user.name}", "visible": "${cart.items.length > 0}", "onTap": "${actions.navigateToPage('details', { id: item.id })}" } ``` -------------------------------- ### Example Usage with Font Weights Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/font-factory.md Demonstrates how to create TextStyle objects with different font weights using the Font Factory. ```APIDOC ### Example with Weights ```dart final thinStyle = fontFactory.createTextStyle( fontSize: 14.0, fontWeight: FontWeight.w100, ); final boldStyle = fontFactory.createTextStyle( fontSize: 14.0, fontWeight: FontWeight.w700, ); final regularStyle = fontFactory.createTextStyle( fontSize: 14.0, fontWeight: FontWeight.normal, ); ``` ``` -------------------------------- ### Instantiate NetworkFirstStrategy Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/initialization.md Example of how to create an instance of NetworkFirstStrategy with a specified network timeout. ```dart final strategy = NetworkFirstStrategy(timeoutInMs: 2000); ``` -------------------------------- ### Example: Accessing Message Bus for Event Subscription Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/digia-ui-scope.md Shows how to get the message bus from DigiaUIScope and subscribe to a specific event within a StatefulWidget's initState. ```dart class MyWidget extends StatefulWidget { @override State createState() => _MyWidgetState(); } class _MyWidgetState extends State { late StreamSubscription _subscription; @override void initState() { super.initState(); final messageBus = DigiaUIScope.of(context).messageBus; if (messageBus != null) { _subscription = messageBus.on('event_name').listen((message) { // Handle message }); } } @override void dispose() { _subscription.cancel(); super.dispose(); } @override Widget build(BuildContext context) { return Container(); } } ``` -------------------------------- ### Dart Method Signature and Example Usage Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/00-START-HERE.md Illustrates a typical Dart method signature with parameters and a basic example of its usage. Includes a pattern for error handling with a try-catch block. ```dart // Method signature void methodName(Type param1, Type param2) // Example usage methodName(value1, value2); // Full example with error handling try { methodName(value1, value2); } catch (e) { // Handle error } ``` -------------------------------- ### ApiServerInfo Example Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/analytics.md Example of creating an ApiServerInfo instance to represent an API server error, including request details and status code. ```dart final errorInfo = ApiServerInfo( null, // data {'url': 'https://api.example.com/users', 'method': 'GET'}, 500, // statusCode Exception('Internal Server Error'), 'Server returned 500 error', ); ``` -------------------------------- ### Message Bus Integration Example Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/messaging.md Demonstrates listening for a specific message ('show_snackbar') on the message bus and safely displaying a SnackBar using the message's context. ```dart final message = Message( name: 'show_snackbar', payload: {'text': 'Item added to cart'}, ); messageBus.on('show_snackbar').listen((message) { final context = message.getMountedContext(); if (context != null && context.mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar(text: message.payload?['text']), ); } }); ``` -------------------------------- ### Create Initial Application Page Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/ui-factory.md Use this method to create the very first page displayed when the application starts. Typically used as the `home` widget in `MaterialApp`. ```dart Widget createInitialPage() ``` ```dart MaterialApp( home: DUIFactory().createInitialPage(), ) ``` -------------------------------- ### Asset Path Format Example Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/configuration.md Illustrates the correct format for specifying asset paths within the application. Avoid leading slashes and ensure the path accurately reflects the file's location in the assets directory. ```dart appConfigPath: 'assets/json/app_config.json' // Correct // NOT: appConfigPath: '/assets/json/app_config.json' // Wrong - no leading slash appConfigPath: 'assets/app_config.json' // Wrong - missing subdirectory ``` -------------------------------- ### Analytics Implementation Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/SUMMARY.txt Guide on implementing tracking and analytics features. ```APIDOC ## Analytics ### Description Instructions and guidance for implementing tracking and analytics features using the Digia UI SDK. ### Endpoint N/A (SDK Feature) ### Usage Refer to the `analytics.md` document for implementation details. ``` -------------------------------- ### DigiaUIApp Initialization with Firebase Analytics Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/analytics.md Example of initializing DigiaUI and running the application with a custom FirebaseAnalyticsHandler. Ensure WidgetsFlutterBinding is initialized before calling runApp. ```dart void main() async { WidgetsFlutterBinding.ensureInitialized(); final digiaUI = await DigiaUI.initialize( DigiaUIOptions( accessKey: 'YOUR_ACCESS_KEY', flavor: Flavor.release(...), ), ); runApp( DigiaUIApp( digiaUI: digiaUI, analytics: FirebaseAnalyticsHandler(), builder: (context) => MaterialApp( home: DUIFactory().createInitialPage(), ), ), ); } ``` -------------------------------- ### Initialize DigiaUIApp Widget Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/configuration.md Configure the root `DigiaUIApp` widget with essential parameters such as the DigiaUI instance, analytics, message bus, and custom providers. This example shows how to provide custom icons, images, and environment variables. ```dart DigiaUIApp({ required DigiaUI digiaUI, DUIAnalytics? analytics, MessageBus? messageBus, ConfigProvider? pageConfigProvider, Map? icons, Map>? images, DUIFontFactory? fontFactory, Map? environmentVariables, required Widget Function(BuildContext) builder, }) ``` ```dart DigiaUIApp( digiaUI: digiaUI, analytics: FirebaseAnalyticsHandler(), messageBus: MessageBus(), icons: { 'app_icon': Icons.star, 'favorite': Icons.favorite_outline, }, images: { 'logo': AssetImage('assets/images/logo.png'), }, fontFactory: CustomFontFactory(), environmentVariables: { 'apiBaseUrl': 'https://api.example.com', 'appVersion': '1.0.0', 'isDarkMode': true, }, builder: (context) => MaterialApp( home: DUIFactory().createInitialPage(), ), ) ``` -------------------------------- ### Creating and Registering a Custom Virtual Widget Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/pages-and-components.md Example of creating a custom `VirtualWidget` named `MyCustomWidget` and registering it with the `DUIFactory`. This involves defining its properties and the `render` method. ```dart class MyCustomWidget extends VirtualWidget { final MyProps props; MyCustomWidget({ required this.props, String? refName, VirtualWidget? parent, }) : super(refName: refName, parent: parent); @override Widget render(RenderPayload payload) { return Container( color: props.backgroundColor, child: Text(props.title), ); } } // Register the widget DUIFactory().registerWidget( 'custom/myWidget', (json) => MyProps.fromJson(json), (props, childGroups) => MyCustomWidget(props: props), ); ``` -------------------------------- ### MultiFontFactory Implementation Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/font-factory.md An example implementation of a Font Factory that uses different font families based on font size. ```APIDOC ## Custom Font Family Configuration ### Using Multiple Font Families ```dart class MultiFontFactory extends DUIFontFactory { @override TextStyle createTextStyle({ Color? color, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? lineHeight, TextDecoration? decoration, }) { // Use different fonts for different sizes final fontFamily = (fontSize ?? 0) > 24 ? 'HeadingFont' : 'CustomFont'; return TextStyle( color: color ?? Colors.black, fontSize: fontSize ?? 14.0, fontWeight: fontWeight ?? FontWeight.normal, fontStyle: fontStyle ?? FontStyle.normal, letterSpacing: letterSpacing, height: lineHeight, decoration: decoration, fontFamily: fontFamily, ); } } ``` ``` -------------------------------- ### Example State Definition in JSON Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/configuration.md Define global application state properties, including their keys, initial values, persistence settings, and optional descriptions. This JSON structure is typically managed in Digia Studio. ```json { "appState": [ { "key": "user", "initialValue": null, "shouldPersist": true, "description": "Current logged in user" }, { "key": "cartCount", "initialValue": 0, "shouldPersist": true, "description": "Number of items in cart" } ] } ``` -------------------------------- ### Initialize MaterialApp for Full App Mode Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/pages-and-components.md Configure your MaterialApp to use DUIFactory for creating the initial page and handling route generation. This setup is essential for running the Digia UI application in full app mode. ```dart MaterialApp( home: DUIFactory().createInitialPage(), onGenerateRoute: (settings) { return DUIFactory().createPageRoute( settings.name!, settings.arguments as Map?, ); }, ) ``` -------------------------------- ### Initialize Digia UI Runtime Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Perform runtime initialization for Digia UI after the initial setup. This includes setting custom icons, images, font factories, and environment variables. ```dart // After initialization DUIFactory().initialize( icons: customIcons, images: customImages, fontFactory: fontFactory, ); DUIFactory().setEnvironmentVariables({ 'apiUrl': 'https://api.example.com', 'appVersion': '1.0.0', }); ``` -------------------------------- ### Implement onDataSourceSuccess for Analytics Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/analytics.md Implement the onDataSourceSuccess method to log successful data source calls. This example logs the data source type, source, response time, and status code. ```dart class MyAnalyticsHandler extends DUIAnalytics { @override void onDataSourceSuccess( String dataSourceType, String source, dynamic metaData, dynamic perfData, ) { // Log successful data source calls logger.info( 'Data source success', { 'type': dataSourceType, 'source': source, 'responseTime': perfData?['duration'], 'statusCode': metaData?['statusCode'], }, ); } } ``` -------------------------------- ### Initialize and Run DigiaUIApp Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/digia-ui-app.md Demonstrates how to initialize the DigiaUI SDK and run the application using DigiaUIApp. This includes setting up access keys, flavor configurations, and providing optional handlers for analytics and message bus. ```dart void main() async { WidgetsFlutterBinding.ensureInitialized(); final digiaUI = await DigiaUI.initialize( DigiaUIOptions( accessKey: 'YOUR_PROJECT_ACCESS_KEY', flavor: Flavor.release( initStrategy: NetworkFirstStrategy(timeoutInMs: 2000), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ), ), ); runApp( DigiaUIApp( digiaUI: digiaUI, analytics: MyAnalyticsHandler(), messageBus: MessageBus(), icons: {'custom_icon': Icons.star}, environmentVariables: {'authToken': '1234567890'}, builder: (context) => MaterialApp( home: DUIFactory().createInitialPage(), ), ), ); } ``` -------------------------------- ### Creating Pages via DUIFactory Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/pages-and-components.md Pages should be created using DUIFactory to ensure proper initialization and integration within the Digia UI framework. This method handles the instantiation and setup of pages. ```APIDOC ## Creating Pages via DUIFactory ### Description Use `DUIFactory` to create and navigate to pages, ensuring proper framework integration. ### Usage Examples ```dart // Create a page with arguments Widget page = DUIFactory().createPage( 'product_details', {'productId': '123'}, ); // Navigate to a page Navigator.push( context, DUIFactory().createPageRoute('checkout', {'cartId': '456'}) ); ``` ``` -------------------------------- ### Initialize Digia UI SDK with Options Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/configuration.md Configure the Digia UI SDK with access key, flavor, and network settings. Ensure the flavor is correctly specified for the environment. ```dart final options = DigiaUIOptions( accessKey: 'pk_project_abc123xyz', flavor: Flavor.release( initStrategy: NetworkFirstStrategy(timeoutInMs: 2000), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ), networkConfiguration: NetworkConfiguration( connectTimeout: Duration(seconds: 30), receiveTimeout: Duration(seconds: 30), ), ); ``` -------------------------------- ### AnalyticEvent.toJson Example Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/analytics.md Example of serializing an AnalyticEvent to JSON. The resulting map can be sent to an analytics backend. ```dart final event = AnalyticEvent( name: 'purchase_complete', payload: {'orderId': '123', 'amount': 99.99}, ); final json = event.toJson(); // Sends to analytics backend ``` -------------------------------- ### Getting Direct Values Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/state-management.md Gets the current value of a state directly without the reactive wrapper. ```APIDOC ## getValue(String key) ### Description Gets the current value directly without the reactive wrapper. ### Method `T getValue(String key)` ### Parameters #### Path Parameters - **key** (String) - Required - The state key to retrieve ### Returns `T` — The current value of the state ### Example ```dart final userId = DUIAppState().getValue('userId'); ``` ``` -------------------------------- ### AnalyticEvent.fromJson Example Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/analytics.md Example of deserializing an AnalyticEvent from a JSON map. This is useful for reconstructing events from stored data or network responses. ```dart final event = AnalyticEvent.fromJson({ 'name': 'button_clicked', 'payload': {'buttonId': 'submit_btn', 'page': 'checkout'}, }); ``` -------------------------------- ### Initialization Configuration Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Configure the Digia UI SDK with essential options including access key, flavor, and network settings. ```APIDOC ## Initialization Configuration ### Description Configure the Digia UI SDK with essential options including access key, flavor, and network settings. ### Method ```dart DigiaUIOptions( accessKey: 'YOUR_KEY', // Required: From Digia Studio flavor: Flavor.release(...), // Required: How to load config networkConfiguration: ..., // Optional: Network settings ) ``` ``` -------------------------------- ### LocalFirstStrategy Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/initialization.md Loads configuration exclusively from local assets, providing the fastest and most reliable startup. ```APIDOC ## LocalFirstStrategy ### Description Loads configuration exclusively from local assets, providing the fastest and most reliable startup. ### Constructor `LocalFirstStrategy()` ### Parameters None ### Request Example ```dart final strategy = LocalFirstStrategy(); ``` ### Response None (This is a constructor definition) ``` -------------------------------- ### Initialize Digia UI with Options Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/initialization.md Use DigiaUIOptions to configure the SDK with your access key, environment flavor, and optional network settings. ```dart final options = DigiaUIOptions( accessKey: 'YOUR_ACCESS_KEY', flavor: Flavor.release( initStrategy: NetworkFirstStrategy(timeoutInMs: 2000), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ), networkConfiguration: NetworkConfiguration.withDefaults(), ); ``` -------------------------------- ### Get Current State Value Directly Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/state-management.md Gets the current value of a state directly without the reactive wrapper. Throws an exception if state not initialized, key not found, or type mismatch. ```dart T getValue(String key) ``` ```dart final userId = DUIAppState().getValue('userId'); ``` -------------------------------- ### Initialize Digia UI SDK (Release Flavor) Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/QUICK-REFERENCE.md Initializes the Digia UI SDK for production use with network-first strategy and specified configuration paths. Ensure 'YOUR_ACCESS_KEY' is replaced with a valid key. ```dart void main() async { WidgetsFlutterBinding.ensureInitialized(); final digiaUI = await DigiaUI.initialize( DigiaUIOptions( accessKey: 'YOUR_ACCESS_KEY', flavor: Flavor.release( initStrategy: NetworkFirstStrategy(timeoutInMs: 2000), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ), ), ); runApp( DigiaUIApp( digiaUI: digiaUI, builder: (context) => MaterialApp( home: DUIFactory().createInitialPage(), ), ), ); } ``` -------------------------------- ### DigiaUI.initialize() Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/initialization.md Initializes the Digia UI SDK with the provided configuration. This method is asynchronous and returns a fully initialized DigiaUI instance. ```APIDOC ## DigiaUI.initialize() ### Description Initializes the Digia UI SDK with the provided configuration. ### Method Signature `static Future initialize(DigiaUIOptions options)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters Table | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | options | DigiaUIOptions | Yes | — | SDK configuration containing access key, flavor, and environment | ### Response #### Success Response - **DigiaUI** (DigiaUI) - A fully initialized DigiaUI instance ready for use. ### Throws Exceptions if initialization fails (network errors, invalid config, etc.) ### Example ```dart import 'package:digia_ui/digia_ui.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); final digiaUI = await DigiaUI.initialize( DigiaUIOptions( accessKey: 'your_project_access_key', flavor: Flavor.release( initStrategy: NetworkFirstStrategy(timeoutInMs: 2000), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ), ), ); runApp( DigiaUIApp( digiaUI: digiaUI, builder: (context) => MaterialApp( home: DUIFactory().createInitialPage(), ), ), ); } ``` ``` -------------------------------- ### Initialization - Release Flavor Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/QUICK-REFERENCE.md Initializes the Digia UI SDK for production with specified options, including access key, flavor configuration, and asset paths. ```APIDOC ## Initialization - Release Flavor ### Description Initializes the Digia UI SDK for production. ### Code Example ```dart void main() async { WidgetsFlutterBinding.ensureInitialized(); final digiaUI = await DigiaUI.initialize( DigiaUIOptions( accessKey: 'YOUR_ACCESS_KEY', flavor: Flavor.release( initStrategy: NetworkFirstStrategy(timeoutInMs: 2000), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ), ), ); runApp( DigiaUIApp( digiaUI: digiaUI, builder: (context) => MaterialApp( home: DUIFactory().createInitialPage(), ), ), ); } ``` ``` -------------------------------- ### Custom Fonts Factory Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/SUMMARY.txt Guide for implementing and managing custom fonts. ```APIDOC ## Font Factory ### Description This document guides users on how to implement and manage custom fonts using the Font Factory within the Digia UI SDK. ### Endpoint N/A (SDK Feature) ### Usage Refer to the `font-factory.md` document for detailed instructions on custom font implementation. ``` -------------------------------- ### Create Initial Page Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Create the initial page of the application. ```APIDOC ## Create Initial Page ### Description Create the initial page of the application. ### Method ```dart DUIFactory().createInitialPage() ``` ``` -------------------------------- ### Get App State Value Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Retrieve a value from the global application state using its key. ```APIDOC ## Get App State Value ### Description Retrieve a value from the global application state using its key. ### Method ```dart final value = DUIAppState().getValue('key') ``` ``` -------------------------------- ### Create and Navigate Pages with DUIFactory Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/pages-and-components.md Demonstrates how to use DUIFactory to instantiate a page with specific arguments and how to create a route for navigation. ```dart // Create a page with arguments Widget page = DUIFactory().createPage( 'product_details', {'productId': '123'}, ); // Navigate to a page Navigator.push( context, DUIFactory().createPageRoute('checkout', {'cartId': '456'}), ); ``` -------------------------------- ### Get Global State Value Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/QUICK-REFERENCE.md Retrieve a value from the global state manager by its key and expected type. ```dart final userId = DUIAppState().getValue('userId'); final count = DUIAppState().getValue('cartCount'); ``` -------------------------------- ### Core Initialization Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/INDEX.md Initialize the Digia UI SDK and configure its options. Supports various initialization strategies and flavor types. ```APIDOC ## Initialization ### Description Initialize the Digia UI SDK with specified options and flavor. ### Method `DigiaUI.initialize(DigiaUIOptions options, Flavor flavor)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```dart DigiaUI.initialize(DigiaUIOptions(...), Flavor.release()); ``` ### Response #### Success Response SDK is initialized. #### Response Example None ``` ```APIDOC ## DigiaUIOptions ### Description Configuration container for the Digia UI SDK. ### Method `DigiaUIOptions` constructor ### Parameters - `field1` (type) - Required/Optional - Description ### Request Example ```dart final options = DigiaUIOptions( // configuration parameters ); ``` ### Response #### Success Response An instance of `DigiaUIOptions`. #### Response Example None ``` ```APIDOC ## Flavor Types ### Description Defines the deployment environment for the SDK. ### Methods - `Flavor.release()` - `Flavor.debug()` - `Flavor.staging()` - `Flavor.versioned(String version)` ### Parameters - `version` (String) - Required - The version string for `versioned` flavor. ### Request Example ```dart Flavor.release(); Flavor.versioned('1.0.0'); ``` ### Response #### Success Response A `Flavor` object representing the environment. #### Response Example None ``` ```APIDOC ## Initialization Strategies ### Description Strategies for initializing the SDK, determining network and cache behavior. ### Classes - `NetworkFirstStrategy` - `CacheFirstStrategy` - `LocalFirstStrategy` ### Usage These strategies are typically passed within `DigiaUIOptions` to define how the SDK fetches and caches data. ``` -------------------------------- ### State Management Deep Dive Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/SUMMARY.txt In-depth guide to global reactive state management within the Digia UI SDK. ```APIDOC ## State Management ### Description This document provides a deep dive into the global reactive state management system of the Digia UI SDK. ### Endpoint N/A (SDK Feature) ### Usage Refer to the `state-management.md` document for detailed information and patterns. ``` -------------------------------- ### Example: Accessing DigiaUIScope in a Widget Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/digia-ui-scope.md Demonstrates how to access the message bus and analytics handler from a DigiaUIScope instance within a StatelessWidget. ```dart class MyWidget extends StatelessWidget { @override Widget build(BuildContext context) { final scope = DigiaUIScope.of(context); final messageBus = scope.messageBus; final analytics = scope.analyticsHandler; return Container(); } } ``` -------------------------------- ### CacheFirstStrategy Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/initialization.md Loads configuration from cache first, providing fast startup times. Network updates happen in the background. ```APIDOC ## CacheFirstStrategy ### Description Loads configuration from cache first, providing fast startup times. Network updates happen in the background. ### Constructor `CacheFirstStrategy()` ### Parameters None ### Request Example ```dart final strategy = CacheFirstStrategy(); ``` ### Response None (This is a constructor definition) ``` -------------------------------- ### Initialize DUIFactory with Resources Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/configuration.md Initialize the DUIFactory by providing custom providers for pages, icons, images, and fonts. ```dart DUIFactory().initialize( pageConfigProvider: customConfigProvider, icons: customIcons, images: customImages, fontFactory: customFontFactory, ); ``` -------------------------------- ### Getting Reactive Values Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/state-management.md Retrieves a reactive value by key with proper type checking, providing stream support for changes. ```APIDOC ## get(String key) ### Description Retrieves a reactive value by key with proper type checking. ### Method `ReactiveValue get(String key)` ### Parameters #### Path Parameters - **key** (String) - Required - The state key to retrieve ### Returns `ReactiveValue` — A reactive value container with stream support ### Throws Exception if state not initialized, key not found, or type mismatch ### Example ```dart final userState = DUIAppState().get>('user'); ``` ``` -------------------------------- ### Custom Font Family Setup Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/font-factory.md Configure custom font families and their assets in your Flutter project's pubspec.yaml file. ```APIDOC ## Custom Font Family Configuration ### pubspec.yaml Font Setup ```yaml flutter: fonts: # Primary font family - family: CustomFont fonts: - asset: assets/fonts/custom-regular.ttf weight: 400 - asset: assets/fonts/custom-bold.ttf weight: 700 - asset: assets/fonts/custom-italic.ttf weight: 400 style: italic # Heading font - family: HeadingFont fonts: - asset: assets/fonts/heading-regular.ttf ``` ``` -------------------------------- ### Initialize Digia UI Options Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Configure the core options for Digia UI, including access key, flavor, and network settings. The access key is required and obtained from Digia Studio. ```dart DigiaUIOptions( accessKey: 'YOUR_KEY', // Required: From Digia Studio flavor: Flavor.release(...), // Required: How to load config networkConfiguration: ..., // Optional: Network settings ) ``` -------------------------------- ### Example: Accessing Analytics Handler Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/digia-ui-scope.md Illustrates how to retrieve the analytics handler from DigiaUIScope and use it for custom event tracking within a StatelessWidget. ```dart class MyAnalyticsWidget extends StatelessWidget { @override Widget build(BuildContext context) { final analytics = DigiaUIScope.of(context).analyticsHandler; return GestureDetector( onTap: () { // Track event (the SDK typically does this automatically, // but you can add custom tracking if needed) if (analytics != null) { // Custom tracking if needed } }, child: Text('Tap me'), ); } } ``` -------------------------------- ### Implement NetworkFirstStrategy Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/types.md A network-first initialization strategy that includes a configurable timeout. ```dart class NetworkFirstStrategy extends DSLInitStrategy { final Duration timeout; NetworkFirstStrategy({required int timeoutInMs}); } ``` -------------------------------- ### Analytics Class Hierarchy Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/ARCHITECTURE.md Presents the abstract base class for analytics handlers and examples of user implementations for different analytics services. ```plaintext DUIAnalytics (abstract) └── [User implementations] ├── FirebaseAnalyticsHandler ├── MixpanelHandler └── CustomHandler ``` -------------------------------- ### Initialize DigiaUI SDK with NetworkFirst Strategy Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/README.md Initialize the DigiaUI SDK using the NetworkFirst strategy, which prioritizes fetching the latest DSL configuration from the network. This option is recommended for production environments to ensure users always see the most up-to-date UI. A timeout can be set for fallback to cache or burned DSL config. ```dart void main() async { WidgetsFlutterBinding.ensureInitialized(); final digiaUI = await DigiaUI.initialize( DigiaUIOptions( accessKey: 'YOUR_PROJECT_ACCESS_KEY', flavor: Flavor.release(), // Use a Strategy of your choice. // NetworkFirstStrategy() or CacheFirstStrategy() strategy: NetworkFirstStrategy(timeoutInMs: 2000), ), ); runApp( DigiaUIApp( digiaUI: digiaUI, builder: (context) => MaterialApp( home: DUIFactory().createInitialPage(), ), ), ); } ``` -------------------------------- ### Create Custom Widget (Dart) Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/QUICK-REFERENCE.md Create a custom widget by extending `VirtualWidget` and implementing the `render` method. This example shows a map widget. ```dart class CustomMapWidget extends VirtualWidget { final MapProps props; CustomMapWidget(this.props) : super(refName: null, parent: null); @override Widget render(RenderPayload payload) { return GoogleMap( initialCameraPosition: CameraPosition( target: LatLng(props.latitude, props.longitude), zoom: props.zoom, ), ); } } ``` -------------------------------- ### App Wrapper Documentation Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/SUMMARY.txt Documentation for using App wrappers within the Digia UI SDK. ```APIDOC ## App Wrapper ### Description Information on how to integrate and use App wrappers provided by the Digia UI SDK. ### Endpoint N/A (SDK Feature) ### Usage Consult the `digia-ui-app.md` document for details on App wrapper functionality. ``` -------------------------------- ### Configure DigiaUI Flavor and Options Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/configuration.md Set up the application's flavor, specifying the target environment and providing necessary options like the access key. ```dart final flavor = Flavor.debug( environment: Environment.development, // Use dev API ); final options = DigiaUIOptions( accessKey: 'dev_key', flavor: flavor, ); ``` -------------------------------- ### Navigate to Digia UI Page from Native Flutter Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Example of navigating to a Digia UI page from a native Flutter screen using Navigator.push. ```dart // Navigate to Digia UI page from native Flutter Navigator.push( context, MaterialPageRoute( builder: (_) => DUIFactory().createPage('page_id', arguments), ), ); ``` -------------------------------- ### Initialization - Debug Flavor Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/QUICK-REFERENCE.md Configures the Digia UI SDK for development with a specified feature branch. ```APIDOC ## Initialization - Debug Flavor ### Description Configures the Digia UI SDK for development. ### Code Example ```dart Flavor.debug(branchName: 'feature/branch') ``` ``` -------------------------------- ### Setting Global State from Native Code Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/state-management.md This example shows how to set a global application state value, such as an authentication token, from native code using DUIAppState. ```dart DUIAppState().setValue('authToken', 'xyz123'); ``` -------------------------------- ### Create Initial Page Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/ui-factory.md Generates the application's primary landing page widget. ```APIDOC ## createInitialPage() ### Description Creates the initial or landing page widget for the application. ### Method `Widget createInitialPage()` ### Returns `Widget` - The widget representing the initial page. ### Request Example ```dart MaterialApp( home: DUIFactory().createInitialPage(), ) ``` ``` -------------------------------- ### Implement onEvent for Analytics Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/analytics.md Implement the onEvent method to process and send analytics events. This example iterates through a list of AnalyticEvent objects and logs their names and payloads. ```dart class MyAnalyticsHandler extends DUIAnalytics { @override void onEvent(List events) { for (final event in events) { // Send to analytics service analytics.logEvent( name: event.name, parameters: event.payload, ); } } } ``` -------------------------------- ### Create Component with Arguments for User Profile Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/pages-and-components.md Demonstrates creating a 'user_profile' component with specific arguments like userId, showEmail, and theme. Arguments are accessible within component expressions using the {args.argumentName} syntax. ```dart DUIFactory().createComponent( 'user_profile', { 'userId': '123', 'showEmail': true, 'theme': 'dark', }, ) // In component expressions: {args.userId}, {args.showEmail}, etc. ``` -------------------------------- ### Creating a Page with Arguments Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/pages-and-components.md Shows how to create a new page using DUIFactory and pass initial arguments. These arguments can be accessed later within the page's expressions. ```dart DUIFactory().createPage( 'checkout_page', { 'cartId': '12345', 'totalAmount': 99.99, 'userId': 'user_123', }, ) ``` -------------------------------- ### Get Digia UI Scope Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/QUICK-REFERENCE.md Obtain the Digia UI scope instance from the build context. This is the entry point for accessing various Digia UI services. ```dart final scope = DigiaUIScope.of(context); ``` -------------------------------- ### Async Initialization with Status Handling Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Initialize Digia UI asynchronously and handle loading and error states before rendering the main application UI. ```dart void main() { runApp( DigiaUIAppBuilder( options: DigiaUIOptions( accessKey: 'your_access_key', flavor: Flavor.release(...), ), builder: (context, status) { if (status.isLoading) { return MaterialApp( home: Scaffold( body: Center(child: CircularProgressIndicator()), ), ); } if (status.hasError) { return MaterialApp( home: Scaffold( body: Center(child: Text('Error: ${status.error}')), ), ); } return MaterialApp( home: DUIFactory().createInitialPage(), ); }, ), ); } ``` -------------------------------- ### Retrieve ActionExecutor using DefaultActionExecutor Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/ui-factory.md Use this static method to get the ActionExecutor instance from the widget tree. This executor is responsible for handling action execution within the application. ```dart static ActionExecutor of(BuildContext context) ``` ```dart final executor = DefaultActionExecutor.of(context); // Use executor to execute actions ``` -------------------------------- ### DigiaUIOptions Constructor Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/initialization.md Configure the Digia UI SDK by providing essential details like access key, flavor, and optional network settings. ```APIDOC ## DigiaUIOptions Constructor ### Description Initializes the Digia UI SDK with the necessary configuration. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **accessKey** (String) - Required - The access key for your Digia project (required for authentication) - **flavor** (Flavor) - Required - The environment flavor (development, staging, production) - **networkConfiguration** (NetworkConfiguration?) - Optional - Optional network configuration for customizing API behavior ### Request Example ```dart final options = DigiaUIOptions( accessKey: 'YOUR_ACCESS_KEY', flavor: Flavor.release( initStrategy: NetworkFirstStrategy(timeoutInMs: 2000), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ), networkConfiguration: NetworkConfiguration.withDefaults(), ); ``` ### Response None (Constructor) ``` -------------------------------- ### Implement onDataSourceError for Analytics Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/analytics.md Implement the onDataSourceError method to log and track data source errors. This example logs error details and sends the exception to Sentry for error tracking. ```dart class MyAnalyticsHandler extends DUIAnalytics { @override void onDataSourceError( String dataSourceType, String source, DataSourceErrorInfo errorInfo, ) { // Log data source errors logger.error( 'Data source error', { 'type': dataSourceType, 'source': source, 'statusCode': errorInfo.statusCode, 'message': errorInfo.message, 'error': errorInfo.error, }, ); // Send to error tracking service Sentry.captureException( errorInfo.error, stackTrace: errorInfo.error is Exception ? null : null, tags: { 'source': source, 'type': dataSourceType, }, ); } } ``` -------------------------------- ### Handle Undefined Variable in Expression Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/errors.md This comment suggests using safe navigation and default values within expressions to recover from cases where a variable is not found. It provides an example fallback format. ```dart // Use safe navigation and default values in expressions // Define fallback: {state.missing | 'default_value'} ``` -------------------------------- ### LocalFirstStrategy Initialization Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/configuration.md Best for completely offline apps or when maximum performance is required. This strategy uses only local assets and makes no network requests. ```dart class LocalFirstStrategy extends DSLInitStrategy {} ``` ```dart Flavor.release( initStrategy: LocalFirstStrategy(), appConfigPath: 'assets/json/app_config.json', functionsPath: 'assets/json/functions.json', ) ``` -------------------------------- ### Initialization - Async Builder Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/QUICK-REFERENCE.md Provides a way to build the application asynchronously, handling loading and error states during Digia UI SDK initialization. ```APIDOC ## Initialization - Async Builder ### Description Builds the application asynchronously, managing initialization states. ### Code Example ```dart DigiaUIAppBuilder( options: options, builder: (context, status) { if (status.isLoading) return LoadingScreen(); if (status.hasError) return ErrorScreen(error: status.error); return MainApp(); }, ) ``` ``` -------------------------------- ### Manage Global State Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Utilize DUIAppState for global state management. Initialize with state descriptors, get, update, and listen to changes in state values. Remember to cancel subscriptions when no longer needed. ```dart // Initialize with state descriptors DUIAppState().init(stateDescriptors) // Get value final value = DUIAppState().getValue('key') // Update value DUIAppState().setValue('key', newValue) // Listen to changes final sub = DUIAppState().listen('key', (value) { // React to changes }); // Clean up sub.cancel() ``` -------------------------------- ### Async Initialization with DigiaUIAppBuilder Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/QUICK-REFERENCE.md Handles asynchronous initialization of the Digia UI SDK, displaying loading or error states as needed. This pattern is useful for managing the SDK's initialization lifecycle. ```dart DigiaUIAppBuilder( options: options, builder: (context, status) { if (status.isLoading) return LoadingScreen(); if (status.hasError) return ErrorScreen(error: status.error); return MainApp(); }, ) ``` -------------------------------- ### DUIPage Constructor Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/pages-and-components.md The DUIPage constructor initializes a full-screen page with essential parameters like ID, arguments, definition, and registry. Optional parameters allow for UI resources, scope context, API models, navigator key, and a controller. ```APIDOC ## DUIPage Constructor ### Description Initializes a full-screen page with essential parameters. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters Table | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | pageId | String | Yes | Unique identifier of the page | | pageArgs | JsonLike? | Yes | Arguments passed to the page (can be null) | | pageDef | DUIPageDefinition | Yes | Page definition from DSL configuration | | registry | VirtualWidgetRegistry | Yes | Registry of virtual widget builders | | resources | UIResources? | No | UI resources (icons, images, fonts) | | scope | ScopeContext? | No | Expression evaluation scope | | apiModels | Map? | No | API models for data binding | | navigatorKey | GlobalKey? | No | Navigator key for nested navigation | | controller | DUIPageController? | No | Page controller for lifecycle management | ``` -------------------------------- ### Get Reactive State Value Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/api-reference/state-management.md Retrieves a reactive value by key with proper type checking. Returns a ReactiveValue container with stream support. Throws an exception if state not initialized, key not found, or type mismatch. ```dart ReactiveValue get(String key) ``` ```dart final userState = DUIAppState().get>('user'); ``` -------------------------------- ### Initialize App State Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/_autodocs/README.md Initialize the global application state with a list of state descriptors. ```APIDOC ## Initialize App State ### Description Initialize the global application state with a list of state descriptors. ### Method ```dart DUIAppState().init(stateDescriptors) ``` ``` -------------------------------- ### Initialize Digia UI with AppBuilder Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/README.md Use DigiaUIAppBuilder for advanced initialization control, allowing you to decide whether to wait for DigiaUI to be ready. This is useful when your app starts with native Flutter pages before transitioning to DigiaUI screens. Ensure to access DUIFactory only when the SDK is ready. ```dart import 'package:digia_ui/digia_ui.dart'; void main() { runApp( DigiaUIAppBuilder( options: DigiaUIOptions( accessKey: 'YOUR_PROJECT_ACCESS_KEY', // Your project access key flavor: Flavor.release(), // Use release or debug flavor strategy: NetworkFirstStrategy(timeoutInMs: 2000), // Choose your init strategy ), builder: (context, status) { // Make sure to access DUIFactory only when SDK is ready if (status.isReady) { return MaterialApp( home: DUIFactory().createInitialPage(), ); } // Show loading indicator while initializing if (status.isLoading) { return MaterialApp( home: Scaffold( body: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ CircularProgressIndicator(), SizedBox(height: 16), Text('Loading latest content...'), if (status.hasCache) TextButton( onPressed: () => status.useCachedVersion(), child: Text('Use Offline Version'), ), ], ), ), ); } // Show error UI if initialization fails // In practice, this scenario should never occur, but it's a good habit to provide a user-friendly fallback just in case. return MaterialApp( home: Scaffold( body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(Icons.error_outline, size: 48), SizedBox(height: 16), Text('Failed to load content'), Text('Error: ${status.error}'), if (status.hasCache) ElevatedButton( onPressed: () => status.useCachedVersion(), child: Text('Use Cached Version'), ), ], ), ), ), ); }, ), ); } ``` -------------------------------- ### Initialize Digia UI SDK in main.dart Source: https://github.com/digia-technology-private-limited/digia_ui/blob/main/lib/context.md Initialize the Digia UI SDK by wrapping your application with DigiaUIScope and DUIApp. Ensure you provide your access key, base URL, environment, flavor info, and network configuration. ```dart void main() { runApp( DigiaUIScope( child: DUIApp( digiaAccessKey: 'YOUR_ACCESS_KEY', baseUrl: 'YOUR_API_BASE_URL', environment: 'production', flavorInfo: FlavorInfo(...), networkConfiguration: NetworkConfiguration(...), ), ), ); } ```