Files
smooth-app/packages/smooth_app/lib/services/smooth_services.dart
Edouard Marquez 80fde5335b feat: In app review (#3333)
* Implementations for Apple App Store/Google Play/Uri based store

* App Store as a service

* In app review asked after being logged in for the first time

* Don't forget to use the new path for MLKit script

* Remove a warning about the context

* Fix tests not passing

* Update packages/app/lib/entrypoints/android/main_samsung_gallery.dart

Co-authored-by: Marvin M <39344769+M123-dev@users.noreply.github.com>

* Update packages/smooth_app/pubspec.yaml

Co-authored-by: Pierre Slamich <pierre.slamich@gmail.com>
Co-authored-by: Marvin M <39344769+M123-dev@users.noreply.github.com>
Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
2022-11-26 14:30:03 +01:00

34 lines
1.0 KiB
Dart

// ignore_for_file: non_constant_identifier_names
import 'package:app_store_shared/app_store_shared.dart';
import 'package:smooth_app/services/app_store/app_store_service.dart';
import 'package:smooth_app/services/logs/logs_fimber_impl.dart';
import 'package:smooth_app/services/logs/smooth_logs_service.dart';
/// List of services (logs, analytics…) available in the app
class SmoothServices {
factory SmoothServices() {
return _singleton;
}
SmoothServices._internal() {
_logsService = LogsService();
_appStoreService = AppStoreService();
}
static final SmoothServices _singleton = SmoothServices._internal();
late LogsService _logsService;
late AppStoreService _appStoreService;
Future<void> init(AppStore appStore) {
return Future.wait<dynamic>(<Future<dynamic>>[
_logsService.attach(FimberLogImpl()),
_appStoreService.attach(AppStoreWrapper(appStore)),
]);
}
}
LogsService get Logs => SmoothServices()._logsService;
AppStoreService get ApplicationStore => SmoothServices()._appStoreService;