carp_debug_flutter 0.1.1 copy "carp_debug_flutter: ^0.1.1" to clipboard
carp_debug_flutter: ^0.1.1 copied to clipboard

An in-app debugging toolkit for CARP ecosystem apps. Provides a floating, button that opens a debug menu (independent of the host app's widget tree) for switching the authentication/app servers, overr [...]

example/lib/main.dart

import 'package:carp_debug_flutter/carp_debug_flutter.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'demo_app.dart';
import 'demo_data.dart';

/// Entry point for the example app.
///
/// Demonstrates the full wiring of [CarpDebugToolkit]:
///  1. initialize [DebugEnv] (loads persisted launch-argument overrides) before
///     anything reads configuration;
///  2. open the real data stores (shared preferences + sembast) and seed them;
///  3. wrap the host app in [CarpDebugToolkit] with the data sources, launch
///     arguments and apply/restart hooks.
Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final prefs = await SharedPreferences.getInstance();
  await DebugEnv().initialize(preferences: prefs);

  final db = await openDemoDatabase();
  await seedDemoData(prefs, db);

  runApp(
    CarpDebugToolkit(
      enabled: true,
      config: DebugToolkitConfig(
        title: 'Example Debug Toolkit',
        envEntries: demoEnvEntries,
        keyValueStores: [SharedPreferencesKeyValueStore(prefs)],
        databases: [SembastDebugDatabase(db, demoStores)],
        // Live-apply: re-read the new configuration without a restart.
        onApply: () async => demoConfig.reload(),
        // Re-run on the in-process restart path (iOS).
        onReinitialize: () async => demoConfig.reload(),
      ),
      child: const DemoApp(),
    ),
  );
}
1
likes
0
points
146
downloads

Documentation

Documentation

Publisher

verified publishercarp.dk

Weekly Downloads

An in-app debugging toolkit for CARP ecosystem apps. Provides a floating, button that opens a debug menu (independent of the host app's widget tree) for switching the authentication/app servers, overriding launch arguments (--dart-define) at runtime, and inspecting / editing / deleting shared preferences and the local (sembast) database.

Repository (GitHub)
View/report issues

Topics

#debugging #carp

License

unknown (license)

Dependencies

flutter, meta, plugin_platform_interface, sembast, shared_preferences

More

Packages that depend on carp_debug_flutter

Packages that implement carp_debug_flutter