Getting Started

This guide covers everything you need to integrate Digia UI SDK into your Flutter app.

Installation

Step 1: Add the SDK

Recommended: Use Flutter CLI

flutter pub add digia_ui

Alternative: Manual Installation

Add to pubspec.yaml:

dependencies:
  digia_ui: ^1.0.0

Then run:

flutter pub get

Step 2: Get Your Access Key

  1. Open your project

  2. Go to SettingsApp Settings

  3. Copy your Access Key

Screenshot showing the App Settings page in Digia Studio with the Access Key field highlighted.
Locate your Access Key in the App Settings section of your Digia Studio project.

⚠️ Security: Never commit your access key to public repositories.

Basic Setup

Choose Your Initialization Pattern

The SDK offers two initialization approaches. Pick based on your needs:

Pattern
When to Use
Best For

DigiaUIAppBuilder

You want automatic loading/error state handling

✅ New apps, need splash screens

DigiaUIApp

You need the SDK ready before first render

Complex init flows, dependency injection

Use this if:

  • Building a new app

  • Want to show loading indicators during initialization

  • Need error handling built-in

Example from ProductHub Demo:

DigiaUIAppBuilder Example:

Option B: DigiaUIApp (Pre-initialized)

Use this if:

  • You have complex initialization logic

  • Need SDK ready before any widgets render

  • Using dependency injection frameworks

Example from ProductHub Demo:

Understanding Flavors

Flavors control how your app loads UI configuration. Choose based on your environment:

Development

Use for:

  • Active development

  • Real-time config updates from Digia Studio

  • Testing changes immediately without rebuilding

Staging/QA

Use for:

  • Pre-release testing

  • QA environments

  • Stable config that can still be updated remotely

Production

Use for:

  • Production releases

  • Maximum performance and reliability

  • Offline-first capability

💡 See understanding-flavors.md for detailed flavor documentation and init strategies.

Working with Pages and Components

Name Conversion

Digia Studio names are converted to snake_case in code:

Studio Name
Code Reference (slugs)

Product Details

product_details_xCV12O

Shopping Cart

shopping_cart_sV467N

Creating Pages

Creating Components

Integration Patterns

Pattern 1: Full App Mode

When to use: Building entire app in Digia Studio

Best for: Apps where 90%+ of UI is built in Digia Studio

Pattern 2: Hybrid Mode

When to use: Mix native Flutter and Digia UI screens

Best for: Apps needing some native screens with Digia UI components

Pattern 3: Component Embedding

When to use: Use Digia UI components in native screens

Example from ProductHub Demo:

Best for: Apps with complex native logic but wanting Digia UI consistency

Pattern 4: Custom Widgets (Advanced)

When to use: Need completely custom Flutter widgets in Digia Studio

Best for: Specialized components requiring native capabilities

State Management

Global State

Share data between native Flutter and Digia UI:

In Digia Studio, access state with expressions:

Production Deployment

Step 1: Download Assets

  1. Navigate to Release section

  2. Download app_config.json and functions.json

Step 2: Add to Project

Update pubspec.yaml:

Step 3: Use Release Flavor

Init Strategy Options

Strategy
When to Use
Behavior

NetworkFirstStrategy

Want latest updates

Tries network first, falls back to cache/assets

CacheFirstStrategy

Fast startup priority

Uses cache, updates in background

LocalFirstStrategy

Offline-first apps

Uses only local assets, no network

Step 4: Build

Troubleshooting

SDK Initialization Fails

Error: DigiaUIManager is not initialized

Fix: Ensure you await initialization:

Page Not Found

Error: Page/component name not found

Fix: Check name conversion:

  • Studio: "Product Details" → Code: product_details

State Not Updating

Fix: Use AppState or StreamController in Digia Studio or execute actions like setState or rebuildState in Digia Studio

Assets Not Loading (Release)

Fix: Verify pubspec.yaml includes assets:

Next Steps

Support

Last updated