m3_lightmeter/lib/screens/timer/components/metering_config/widget_metering_config_timer.dart
Vadim 5c27f726c5
ML-173 Add a timer for long exposures (#174)
* wip

* added start/stop button

* animated timeline

* fixed timer stop state

* added reset button (wip)

* added `onExposurePairTap` callback

* integrated `TimerScreen` to navigation

* separated `TimerTimeline`

* fixed timeline flickering

* added milliseconds to timer

* synchronized timeline with actual timer

* reused `BottomControlsBar`

* fixed default scaffold background color

* moved center button size to the bar itself

* display selected exposure pair on timer screen

* separated reusable `AnimatedCircluarButton`

* release camera when timer is opened

* added `TimerInteractor`

* added `TimerBloc` test

* fixed hours parsing

* added scenarios for timer golden test

* adjusted timer timeline colors

* show iso & nd values on timer screen

* automatically close timer screen after timeout

* added timer autostart

* reverted theme changes

* updated goldens

* typo

* removed timer screen auto-dismiss

* increased timer vibration duration

* replaced outlined locks

* increased 1/3 values font size
2024-05-07 19:24:51 +02:00

74 lines
2.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:lightmeter/data/models/exposure_pair.dart';
import 'package:lightmeter/generated/l10n.dart';
import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/metering/components/shared/readings_container/components/shared/reading_value_container/widget_container_reading_value.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
class TimerMeteringConfig extends StatelessWidget {
final ExposurePair exposurePair;
final IsoValue isoValue;
final NdValue ndValue;
const TimerMeteringConfig({
required this.exposurePair,
required this.isoValue,
required this.ndValue,
super.key,
});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surface,
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(Dimens.borderRadiusL),
bottomRight: Radius.circular(Dimens.borderRadiusL),
),
),
padding: const EdgeInsets.all(Dimens.paddingM),
child: SafeArea(
bottom: false,
child: Row(
children: [
Expanded(
child: ReadingValueContainer.singleValue(
value: ReadingValue(
label: S.of(context).exposurePair,
value: exposurePair.toString(),
),
),
),
const SizedBox(width: Dimens.grid8),
Expanded(
child: Row(
children: [
Expanded(
child: ReadingValueContainer.singleValue(
value: ReadingValue(
label: S.of(context).iso,
value: isoValue.toString(),
),
locked: true,
),
),
const SizedBox(width: Dimens.grid8),
Expanded(
child: ReadingValueContainer.singleValue(
value: ReadingValue(
label: S.of(context).nd,
value: ndValue.value == 0 ? S.of(context).none : ndValue.value.toString(),
),
locked: true,
),
),
],
),
),
],
),
),
);
}
}