m3_lightmeter/lib/screens/metering/components/bottom_controls/widget_bottom_controls.dart
Vadim 74d0a7101c
ML-62 Bloc's tests (#78)
* removed redundant `UserPreferencesService` from `MeteringBloc`

* wip

* post-merge fixes

* `MeasureEvent` tests

* `MeasureEvent` tests revision

* `MeasureEvent` tests added timeout

* added stubs for other `MeteringBloc` events

* rewritten `MeteringBloc` logic

* wip

* `IsoChangedEvent` tests

* refined `IsoChangedEvent` tests

* `NdChangedEvent` tests

* `FilmChangedEvent` tests

* `MeteringCommunicationBloc` tests

* added test run to ci

* overriden `==` for `MeasuredState`

* `LuxMeteringEvent` tests

* refined `LuxMeteringEvent` tests

* rename

* wip

* wip

* `InitializeEvent`/`DeinitializeEvent` tests

* clamp minZoomLevel

* fixed `MeteringCommunicationBloc` tests

* wip

* `ZoomChangedEvent` tests

* `ExposureOffsetChangedEvent`/`ExposureOffsetResetEvent` tests

* renamed test groups

* added test coverage script

* improved `CameraContainerBloc` test coverage

* `EquipmentProfileChangedEvent` tests

* verify response vibration

* fixed running all tests

* `MeteringCommunicationBloc` equality tests

* `CameraContainerBloc` equality tests

* removed generated code from coverage
2023-06-20 08:43:49 +02:00

74 lines
2.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:lightmeter/data/models/ev_source_type.dart';
import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/metering/components/bottom_controls/components/measure_button/widget_button_measure.dart';
import 'package:lightmeter/utils/inherited_generics.dart';
class MeteringBottomControls extends StatelessWidget {
final double? ev;
final bool isMetering;
final VoidCallback? onSwitchEvSourceType;
final VoidCallback onMeasure;
final VoidCallback onSettings;
const MeteringBottomControls({
required this.ev,
required this.isMetering,
required this.onSwitchEvSourceType,
required this.onMeasure,
required this.onSettings,
super.key,
});
@override
Widget build(BuildContext context) {
return ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(Dimens.borderRadiusL),
topRight: Radius.circular(Dimens.borderRadiusL),
),
child: ColoredBox(
color: Theme.of(context).colorScheme.surface,
child: SafeArea(
top: false,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: Dimens.paddingL),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
if (onSwitchEvSourceType != null)
Expanded(
child: Center(
child: IconButton(
onPressed: onSwitchEvSourceType,
icon: Icon(
context.listen<EvSourceType>() != EvSourceType.camera
? Icons.camera_rear
: Icons.wb_incandescent,
),
),
),
)
else
const Spacer(),
MeteringMeasureButton(
ev: ev,
isMetering: isMetering,
onTap: onMeasure,
),
Expanded(
child: Center(
child: IconButton(
onPressed: onSettings,
icon: const Icon(Icons.settings),
),
),
),
],
),
),
),
),
);
}
}