//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();*/
    }
  }
}
