diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index b041500..4d0d9c0 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -117,5 +117,6 @@ "tooltipResetToZero": "Reset to zero", "tooltipUseLightSensor": "Use lightsensor", "tooltipUseCamera": "Use camera", - "tooltipOpenSettings": "Open settings" + "tooltipOpenSettings": "Open settings", + "exposurePair": "Exposure pair" } \ No newline at end of file diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index c3941ba..96debfd 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -117,5 +117,6 @@ "tooltipResetToZero": "Remise à zéro", "tooltipUseLightSensor": "Utiliser un capteur de lumière", "tooltipUseCamera": "Utiliser la caméra", - "tooltipOpenSettings": "Ouvrir les paramètres" + "tooltipOpenSettings": "Ouvrir les paramètres", + "exposurePair": "Paire d'exposition" } \ No newline at end of file diff --git a/lib/l10n/intl_ru.arb b/lib/l10n/intl_ru.arb index ef182d8..4c81b02 100644 --- a/lib/l10n/intl_ru.arb +++ b/lib/l10n/intl_ru.arb @@ -117,5 +117,6 @@ "tooltipResetToZero": "Сбросить до 0", "tooltipUseLightSensor": "Использовать датчик освещенности", "tooltipUseCamera": "Использовать камеру", - "tooltipOpenSettings": "Открыть настройки" + "tooltipOpenSettings": "Открыть настройки", + "exposurePair": "Пара экспозиции" } \ No newline at end of file diff --git a/lib/l10n/intl_zh.arb b/lib/l10n/intl_zh.arb index 5d26833..10ab81f 100644 --- a/lib/l10n/intl_zh.arb +++ b/lib/l10n/intl_zh.arb @@ -117,5 +117,6 @@ "resetToZero": "重置为零", "tooltipUseLightSensor": "使用光线传感器", "tooltipUseCamera": "使用摄像头", - "tooltipOpenSettings": "打开设置" + "tooltipOpenSettings": "打开设置", + "exposurePair": "曝光对" } \ No newline at end of file diff --git a/lib/screens/timer/components/metering_config/widget_metering_config_timer.dart b/lib/screens/timer/components/metering_config/widget_metering_config_timer.dart new file mode 100644 index 0000000..78e93e0 --- /dev/null +++ b/lib/screens/timer/components/metering_config/widget_metering_config_timer.dart @@ -0,0 +1,43 @@ +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'; + +class TimerMeteringConfig extends StatelessWidget { + final ExposurePair exposurePair; + + const TimerMeteringConfig({ + required this.exposurePair, + 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(), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/timer/screen_timer.dart b/lib/screens/timer/screen_timer.dart index 10343f3..741bc79 100644 --- a/lib/screens/timer/screen_timer.dart +++ b/lib/screens/timer/screen_timer.dart @@ -4,6 +4,7 @@ import 'package:lightmeter/data/models/exposure_pair.dart'; import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/screens/shared/bottom_controls_bar/widget_bottom_controls_bar.dart'; import 'package:lightmeter/screens/timer/bloc_timer.dart'; +import 'package:lightmeter/screens/timer/components/metering_config/widget_metering_config_timer.dart'; import 'package:lightmeter/screens/timer/components/text/widget_text_timer.dart'; import 'package:lightmeter/screens/timer/components/timeline/widget_timeline_timer.dart'; import 'package:lightmeter/screens/timer/event_timer.dart'; @@ -64,69 +65,55 @@ class _TimerScreenState extends State with TickerProviderStateMixin listenWhen: (previous, current) => previous.runtimeType != current.runtimeType, listener: (context, state) => _updateAnimations(state), child: Scaffold( - appBar: AppBar( - automaticallyImplyLeading: false, - centerTitle: true, - elevation: 0, - title: Text( - widget.exposurePair.toString(), - style: TextStyle( - color: Theme.of(context).colorScheme.onSurface, - fontSize: Dimens.grid24, - ), - ), - ), - body: SafeArea( - bottom: false, - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Spacer(), - Padding( - padding: const EdgeInsets.all(Dimens.paddingL), - child: SizedBox.fromSize( - size: Size.square(MediaQuery.sizeOf(context).width - Dimens.paddingL * 4), - child: ValueListenableBuilder( - valueListenable: timelineAnimation, - builder: (_, value, child) => TimerTimeline( - progress: value, - child: TimerText( - timeLeft: Duration(milliseconds: (widget.duration.inMilliseconds * value).toInt()), - duration: widget.duration, - ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TimerMeteringConfig(exposurePair: widget.exposurePair), + const Spacer(), + Padding( + padding: const EdgeInsets.all(Dimens.paddingL), + child: SizedBox.fromSize( + size: Size.square(MediaQuery.sizeOf(context).width - Dimens.paddingL * 4), + child: ValueListenableBuilder( + valueListenable: timelineAnimation, + builder: (_, value, child) => TimerTimeline( + progress: value, + child: TimerText( + timeLeft: Duration(milliseconds: (widget.duration.inMilliseconds * value).toInt()), + duration: widget.duration, ), ), ), ), - const Spacer(), - BottomControlsBar( - left: IconButton( + ), + const Spacer(), + BottomControlsBar( + left: IconButton( + onPressed: () { + context.read().add(const ResetTimerEvent()); + }, + icon: const Icon(Icons.restore), + ), + center: BlocBuilder( + builder: (_, state) => FloatingActionButton( + shape: state is TimerResumedState ? null : const CircleBorder(), onPressed: () { - context.read().add(const ResetTimerEvent()); + if (timelineAnimation.value == 0) { + return; + } + final event = state is TimerStoppedState ? const StartTimerEvent() : const StopTimerEvent(); + context.read().add(event); }, - icon: const Icon(Icons.restore), - ), - center: BlocBuilder( - builder: (_, state) => FloatingActionButton( - shape: state is TimerResumedState ? null : const CircleBorder(), - onPressed: () { - if (timelineAnimation.value == 0) { - return; - } - final event = state is TimerStoppedState ? const StartTimerEvent() : const StopTimerEvent(); - context.read().add(event); - }, - child: AnimatedIcon( - icon: AnimatedIcons.play_pause, - progress: startStopIconAnimation, - ), + child: AnimatedIcon( + icon: AnimatedIcons.play_pause, + progress: startStopIconAnimation, ), ), - right: Navigator.of(context).canPop() ? const CloseButton() : null, ), - ], - ), + right: Navigator.of(context).canPop() ? const CloseButton() : null, + ), + ], ), ), ),