m3_lightmeter/lib/screens/metering/flow_metering.dart

53 lines
1.8 KiB
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.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';
2022-12-16 08:08:12 +00:00
import 'package:lightmeter/data/shared_prefs_service.dart';
import 'package:lightmeter/interactors/metering_interactor.dart';
2023-03-17 18:24:07 +00:00
import 'package:lightmeter/providers/equipment_profile_provider.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
import 'package:provider/provider.dart';
import 'bloc_metering.dart';
import 'communication/bloc_communication_metering.dart';
import 'screen_metering.dart';
class MeteringFlow extends StatefulWidget {
const MeteringFlow({super.key});
@override
State<MeteringFlow> createState() => _MeteringFlowState();
}
class _MeteringFlowState extends State<MeteringFlow> {
@override
Widget build(BuildContext context) {
return Provider(
create: (context) => MeteringInteractor(
context.read<UserPreferencesService>(),
context.read<CaffeineService>(),
context.read<HapticsService>(),
context.read<PermissionsService>(),
context.read<LightSensorService>(),
),
child: MultiBlocProvider(
providers: [
BlocProvider(create: (_) => MeteringCommunicationBloc()),
BlocProvider(
create: (context) => MeteringBloc(
context.read<MeteringCommunicationBloc>(),
context.read<UserPreferencesService>(),
context.read<MeteringInteractor>(),
2023-03-23 20:23:26 +00:00
EquipmentProfile.of(context, listen: false),
context.read<StopType>(),
),
),
],
child: const MeteringScreen(),
),
);
}
}