You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mohemm-flutter-app/lib/config/background_loader.dart

35 lines
1.1 KiB
Dart

//class which loads components "in the background", i.e. ui does not depend on it
import 'package:mohem_flutter_app/services/shared_preferences.dart';
import 'package:injector/injector.dart';
//import 'package:revocheckapp/services/firebase_service.dart';
class BackgroundLoader {
Future loadBackgroundData() async {
//init notification setting
try {
/*
final isPromotionNotificationEnabled = await Injector.appInstance
.getDependency<ISharedPreferences>()
.promotionNotificationsEnabled;
if (isPromotionNotificationEnabled == null) {
await Injector.appInstance
.getDependency<ISharedPreferences>()
.setPromotionNotificationEnabled(true);
Injector.appInstance
.getDependency<IFirebaseService>()
.subscribeForPromotions();
} */
} catch (_) {
//something wend wrong, set it to true
await Injector.appInstance
.getDependency<ISharedPreferences>()
.setPromotionNotificationEnabled(true);
/*Injector.appInstance
.getDependency<IFirebaseService>()
.subscribeForPromotions();*/
}
}
}