This project provides widgets to facilitate the creation of Archethic DApps
- Flutter 3.24+
- Dart 3.5+
Please, fill /lib/src/l10n/intl_en.arb file to externalize texts.
Best practice: prefix each key with aedappfm_ to avoid doublons with DApp projects
- Generate with Flutter_Gen (command:
flutter gen-l10n) theAppLocalizationsandAppLocalizationsEnclasses in the hidden folder.dart_tool/flutter_gen/gen_l10n. (see/l10n.yamlconf)
flutter gen-l10n- Copy generated classes to a public folder
/lib/src/l10nwith the script./lib/src/l10n/copy_l10n.sh.
./lib/src/l10n/copy_l10n.shAdd aedappfm.AppLocalizations.delegate in localizationsDelegates property of MaterialApp
To avoid key doublons, we recommand to suffix Archethic DApp Framework imports in the DApp project.
For example: import 'package:archethic_dapp_framework_flutter/archethic-dapp-framework-flutter.dart as aedappfm;
ProvidersTracker keeps track of alive providers.
Usage in production is not recommended.
import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm;
runApp(
ProviderScope(
observers: [
if (kDebugMode) aedappfm.ProvidersTracker(),
],
child: const MyApp(),
),
;In debug console, check ProvidersTracker content :
aedappfm.ProvidersTracker().aliveProvidersSet
[0] = AutoDisposeProvider (oracleServiceProvider:AutoDisposeProvider<OracleService>#2d1c8)
[1] = AutoDisposeAsyncNotifierProviderImpl (_archethicOracleUCONotifierProvider:AutoDisposeAsyncNotifierProviderImpl<_ArchethicOracleUCONotifier, ArchethicOracleUCO>#4aa30)
[2] = AutoDisposeProvider (apiServiceProvider:AutoDisposeProvider<ApiService>#e4552)In debug console :
aedappfm.ProvidersTracker().byName('oracle').readSet
[0] = AutoDisposeProvider (oracleServiceProvider:AutoDisposeProvider<OracleService>#2d1c8)
[1] = AutoDisposeAsyncNotifierProviderImpl (_archethicOracleUCONotifierProvider:AutoDisposeAsyncNotifierProviderImpl<_ArchethicOracleUCONotifier, ArchethicOracleUCO>#4aa30)In debug console :
// watch returns a stream. Here we just log the number of providers whose name matches 'oracle'
aedappfm.ProvidersTracker().byName('oracle').watch.forEach((providers) => print('>>> Oracle : ${providers.length}'))Each time the alive providers matching 'oracle' changes, we have a log like this :
>>> Oracle : 2