Skip to content

Commit

Permalink
feat: shared preference init
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanRns committed May 10, 2024
1 parent 927304e commit 9bde0e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
24 changes: 13 additions & 11 deletions evently/lib/utils/di/di.config.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion evently/lib/utils/di/di.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
import 'package:evently/utils/di/di.config.dart';
import 'package:get_it/get_it.dart';
import 'package:injectable/injectable.dart';
import 'package:shared_preferences/shared_preferences.dart';

// Service Locator for project
final sl = GetIt.I;

// initialization of Service locator
@InjectableInit()
void configureDependencies() => sl.init();
void configureDependencies() {
sl.registerSingletonAsync<SharedPreferences>(() => SharedPreferences.getInstance());
sl.init();
}

0 comments on commit 9bde0e1

Please sign in to comment.