m3_lightmeter/lib/providers/services_provider.dart
Vadim fc37016770
ML-154 Improve Crashlytics reports (#155)
* removed unused analytics event & added `logCrash`

* added analytics to `RemoteConfigService`

* run app with `runZonedGuarded`

* added crash logging to `CameraContainerBloc`

* log product id for IAP errors

* typo

* log crashes in `RemoteConfigService`

* ignore silent `FlutterError`

* fixed `evFromImage` test

* fixed `showBuyProDialog` test

* log errors in console

* depend on iap 0.7.2
2024-01-27 23:20:53 +01:00

43 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:lightmeter/data/analytics/analytics.dart';
import 'package:lightmeter/data/caffeine_service.dart';
import 'package:lightmeter/data/haptics_service.dart';
import 'package:lightmeter/data/light_sensor_service.dart';
import 'package:lightmeter/data/permissions_service.dart';
import 'package:lightmeter/data/shared_prefs_service.dart';
import 'package:lightmeter/data/volume_events_service.dart';
import 'package:lightmeter/environment.dart';
// coverage:ignore-start
class ServicesProvider extends InheritedWidget {
final LightmeterAnalytics analytics;
final CaffeineService caffeineService;
final Environment environment;
final HapticsService hapticsService;
final LightSensorService lightSensorService;
final PermissionsService permissionsService;
final UserPreferencesService userPreferencesService;
final VolumeEventsService volumeEventsService;
const ServicesProvider({
required this.analytics,
required this.caffeineService,
required this.environment,
required this.hapticsService,
required this.lightSensorService,
required this.permissionsService,
required this.userPreferencesService,
required this.volumeEventsService,
required super.child,
});
static ServicesProvider of(BuildContext context) => ServicesProvider.maybeOf(context)!;
static ServicesProvider? maybeOf(BuildContext context) {
return context.findAncestorWidgetOfExactType<ServicesProvider>();
}
@override
bool updateShouldNotify(ServicesProvider oldWidget) => false;
}
// coverage:ignore-end