mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 15:30:59 +00:00
ec9ba1a779
* indicate EV value error * allow nullable ev100 in `CameraContainerBloc` * log exif keys * wip * removed `UserPreferencesService` from `MeteringBloc` * added error toast * conflicts * lints * allow stop metering if `hasError` * fixed `AnimatedDialogPicker` inability to close * Update build.gradle
50 lines
1.9 KiB
Dart
50 lines
1.9 KiB
Dart
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';
|
|
import 'package:lightmeter/data/shared_prefs_service.dart';
|
|
import 'package:lightmeter/interactors/metering_interactor.dart';
|
|
import 'package:lightmeter/providers/equipment_profile_provider.dart';
|
|
import 'package:lightmeter/screens/metering/bloc_metering.dart';
|
|
import 'package:lightmeter/screens/metering/communication/bloc_communication_metering.dart';
|
|
import 'package:lightmeter/screens/metering/screen_metering.dart';
|
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
|
import 'package:provider/provider.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<MeteringInteractor>(),
|
|
EquipmentProfile.of(context, listen: false),
|
|
context.read<StopType>(),
|
|
),
|
|
),
|
|
],
|
|
child: const MeteringScreen(),
|
|
),
|
|
);
|
|
}
|
|
}
|