2023-08-14 10:25:37 +00:00
|
|
|
import 'package:flutter/material.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';
|
2023-10-28 20:40:56 +00:00
|
|
|
import 'package:lightmeter/data/remote_config_service.dart';
|
2023-08-14 10:25:37 +00:00
|
|
|
import 'package:lightmeter/data/shared_prefs_service.dart';
|
|
|
|
import 'package:lightmeter/data/volume_events_service.dart';
|
|
|
|
import 'package:lightmeter/environment.dart';
|
|
|
|
|
2023-10-20 14:12:43 +00:00
|
|
|
// coverage:ignore-start
|
2023-08-14 10:25:37 +00:00
|
|
|
class ServicesProvider extends InheritedWidget {
|
|
|
|
final CaffeineService caffeineService;
|
|
|
|
final Environment environment;
|
|
|
|
final HapticsService hapticsService;
|
|
|
|
final LightSensorService lightSensorService;
|
|
|
|
final PermissionsService permissionsService;
|
2023-10-28 20:40:56 +00:00
|
|
|
final RemoteConfigService remoteConfigService;
|
2023-08-14 10:25:37 +00:00
|
|
|
final UserPreferencesService userPreferencesService;
|
|
|
|
final VolumeEventsService volumeEventsService;
|
|
|
|
|
|
|
|
const ServicesProvider({
|
|
|
|
required this.caffeineService,
|
|
|
|
required this.environment,
|
|
|
|
required this.hapticsService,
|
|
|
|
required this.lightSensorService,
|
|
|
|
required this.permissionsService,
|
2023-10-28 20:40:56 +00:00
|
|
|
required this.remoteConfigService,
|
2023-08-14 10:25:37 +00:00
|
|
|
required this.userPreferencesService,
|
|
|
|
required this.volumeEventsService,
|
|
|
|
required super.child,
|
|
|
|
});
|
|
|
|
|
|
|
|
static ServicesProvider of(BuildContext context) {
|
|
|
|
return context.findAncestorWidgetOfExactType<ServicesProvider>()!;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool updateShouldNotify(ServicesProvider oldWidget) => false;
|
|
|
|
}
|
2023-10-20 14:12:43 +00:00
|
|
|
// coverage:ignore-end
|