Files
arcane_framework/example
2026-06-01 17:38:43 +02:00
..
2024-09-18 10:39:46 +02:00
2024-09-18 10:39:46 +02:00
2025-01-23 13:59:40 +01:00

Arcane Framework Example

This example app demonstrates the major Arcane services together in a single Flutter UI:

  • Logging with interceptors and realtime log stream subscriptions
  • Authentication with sign-in and sign-out actions
  • Feature flag toggling with live UI updates
  • Environment switching
  • Theme switching and system theme following (with automatic initial sync when using ArcaneApp)
  • Custom app services via ArcaneService

Run the example

From the repository root:

cd example
flutter pub get
flutter run

Where to look

  • example/lib/main.dart: app bootstrap, Arcane service setup, and all feature demos
  • example/lib/interfaces/debug_print_interface.dart: sample logging interface
  • example/lib/interfaces/debug_auth_interface.dart: sample auth provider
  • example/lib/services/favorite_color_service.dart: custom Arcane service example

Stream subscription lifecycle

The example intentionally uses stream subscriptions in widgets and cancels them in dispose to model lifecycle-safe usage.

Key patterns shown in the app include:

  • Subscribing to Arcane.logger.logStream in initState
  • Canceling subscriptions in dispose
  • Rebuilding UI from stream and notifier changes
  • Rebuilding UI from ArcaneFeatureFlagProvider.of(context) dependencies
  • Using context.featureFlags convenience access in widgets

ArcaneApp composes built-in providers/switchers for Arcane services, feature flags, environment, and theme updates, and this example demonstrates all of them working together.

Use this app as a reference for combining Arcane streams and ValueNotifier listeners in the same codebase.