context.get<MeteringInteractor>()

This commit is contained in:
Vadim 2023-05-30 17:37:48 +02:00
parent c0713e411d
commit 424c54e5e5
3 changed files with 7 additions and 5 deletions

View file

@ -6,6 +6,7 @@ import 'package:lightmeter/interactors/metering_interactor.dart';
import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart'; import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart';
import 'package:lightmeter/screens/metering/components/camera_container/bloc_container_camera.dart'; import 'package:lightmeter/screens/metering/components/camera_container/bloc_container_camera.dart';
import 'package:lightmeter/screens/metering/components/camera_container/widget_container_camera.dart'; import 'package:lightmeter/screens/metering/components/camera_container/widget_container_camera.dart';
import 'package:lightmeter/utils/inherited_generics.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
class CameraContainerProvider extends StatelessWidget { class CameraContainerProvider extends StatelessWidget {
@ -37,7 +38,7 @@ class CameraContainerProvider extends StatelessWidget {
return BlocProvider( return BlocProvider(
lazy: false, lazy: false,
create: (context) => CameraContainerBloc( create: (context) => CameraContainerBloc(
context.read<MeteringInteractor>(), context.get<MeteringInteractor>(),
context.read<MeteringCommunicationBloc>(), context.read<MeteringCommunicationBloc>(),
), ),
child: CameraContainer( child: CameraContainer(

View file

@ -6,6 +6,7 @@ import 'package:lightmeter/interactors/metering_interactor.dart';
import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart'; import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart';
import 'package:lightmeter/screens/metering/components/light_sensor_container/bloc_container_light_sensor.dart'; import 'package:lightmeter/screens/metering/components/light_sensor_container/bloc_container_light_sensor.dart';
import 'package:lightmeter/screens/metering/components/light_sensor_container/widget_container_light_sensor.dart'; import 'package:lightmeter/screens/metering/components/light_sensor_container/widget_container_light_sensor.dart';
import 'package:lightmeter/utils/inherited_generics.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
class LightSensorContainerProvider extends StatelessWidget { class LightSensorContainerProvider extends StatelessWidget {
@ -37,7 +38,7 @@ class LightSensorContainerProvider extends StatelessWidget {
return BlocProvider( return BlocProvider(
lazy: false, lazy: false,
create: (context) => LightSensorContainerBloc( create: (context) => LightSensorContainerBloc(
context.read<MeteringInteractor>(), context.get<MeteringInteractor>(),
context.read<MeteringCommunicationBloc>(), context.read<MeteringCommunicationBloc>(),
), ),
child: LightSensorContainer( child: LightSensorContainer(

View file

@ -23,8 +23,8 @@ class MeteringFlow extends StatefulWidget {
class _MeteringFlowState extends State<MeteringFlow> { class _MeteringFlowState extends State<MeteringFlow> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Provider( return InheritedWidgetBase<MeteringInteractor>(
create: (context) => MeteringInteractor( data: MeteringInteractor(
context.get<UserPreferencesService>(), context.get<UserPreferencesService>(),
context.get<CaffeineService>(), context.get<CaffeineService>(),
context.get<HapticsService>(), context.get<HapticsService>(),
@ -37,7 +37,7 @@ class _MeteringFlowState extends State<MeteringFlow> {
BlocProvider( BlocProvider(
create: (context) => MeteringBloc( create: (context) => MeteringBloc(
context.read<MeteringCommunicationBloc>(), context.read<MeteringCommunicationBloc>(),
context.read<MeteringInteractor>(), context.get<MeteringInteractor>(),
context.get<EquipmentProfile>(), context.get<EquipmentProfile>(),
context.get<StopType>(), context.get<StopType>(),
), ),