mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-24 00:10:47 +00:00
context.get<MeteringInteractor>()
This commit is contained in:
parent
c0713e411d
commit
424c54e5e5
3 changed files with 7 additions and 5 deletions
|
@ -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(
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -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>(),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue