Feature #2: Fluttery Framework - Base Essentials #7

Merged
boom merged 13 commits from fluttery-framework into dev 2025-09-23 21:01:19 +02:00
2 changed files with 4 additions and 5 deletions
Showing only changes of commit cfd38211a2 - Show all commits

View File

@@ -8,7 +8,7 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
// any services // any services
App.registerDefaultServices(); await App.registerDefaultServices();
final logger = App.service<Logger>(); final logger = App.service<Logger>();
logger.debug("[MAIN] Registered all default services"); logger.debug("[MAIN] Registered all default services");

View File

@@ -30,12 +30,11 @@ class App {
} }
/// Registers the default services required by the application. /// Registers the default services required by the application.
static void registerDefaultServices() { static Future<void> registerDefaultServices() async {
registerService<Logger>(() => LoggerImpl()); registerService<Logger>(() => LoggerImpl());
SharedPreferences.getInstance().then((instance) { final prefs = await SharedPreferences.getInstance();
registerService<Preferences>(() => PreferencesImpl(instance: instance)); registerService<Preferences>(() => PreferencesImpl(instance: prefs));
});
registerService<SecureStorage>(() => SecureStorageImpl()); registerService<SecureStorage>(() => SecureStorageImpl());
} }