display selected exposure pair on timer screen

This commit is contained in:
Vadim 2024-05-03 12:04:54 +02:00
parent 04bd00b2c0
commit 43ab97f87f
6 changed files with 92 additions and 58 deletions

View file

@ -117,5 +117,6 @@
"tooltipResetToZero": "Reset to zero", "tooltipResetToZero": "Reset to zero",
"tooltipUseLightSensor": "Use lightsensor", "tooltipUseLightSensor": "Use lightsensor",
"tooltipUseCamera": "Use camera", "tooltipUseCamera": "Use camera",
"tooltipOpenSettings": "Open settings" "tooltipOpenSettings": "Open settings",
"exposurePair": "Exposure pair"
} }

View file

@ -117,5 +117,6 @@
"tooltipResetToZero": "Remise à zéro", "tooltipResetToZero": "Remise à zéro",
"tooltipUseLightSensor": "Utiliser un capteur de lumière", "tooltipUseLightSensor": "Utiliser un capteur de lumière",
"tooltipUseCamera": "Utiliser la caméra", "tooltipUseCamera": "Utiliser la caméra",
"tooltipOpenSettings": "Ouvrir les paramètres" "tooltipOpenSettings": "Ouvrir les paramètres",
"exposurePair": "Paire d'exposition"
} }

View file

@ -117,5 +117,6 @@
"tooltipResetToZero": "Сбросить до 0", "tooltipResetToZero": "Сбросить до 0",
"tooltipUseLightSensor": "Использовать датчик освещенности", "tooltipUseLightSensor": "Использовать датчик освещенности",
"tooltipUseCamera": "Использовать камеру", "tooltipUseCamera": "Использовать камеру",
"tooltipOpenSettings": "Открыть настройки" "tooltipOpenSettings": "Открыть настройки",
"exposurePair": "Пара экспозиции"
} }

View file

@ -117,5 +117,6 @@
"resetToZero": "重置为零", "resetToZero": "重置为零",
"tooltipUseLightSensor": "使用光线传感器", "tooltipUseLightSensor": "使用光线传感器",
"tooltipUseCamera": "使用摄像头", "tooltipUseCamera": "使用摄像头",
"tooltipOpenSettings": "打开设置" "tooltipOpenSettings": "打开设置",
"exposurePair": "曝光对"
} }

View file

@ -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(),
),
),
),
],
),
),
);
}
}

View file

@ -4,6 +4,7 @@ import 'package:lightmeter/data/models/exposure_pair.dart';
import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/shared/bottom_controls_bar/widget_bottom_controls_bar.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/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/text/widget_text_timer.dart';
import 'package:lightmeter/screens/timer/components/timeline/widget_timeline_timer.dart'; import 'package:lightmeter/screens/timer/components/timeline/widget_timeline_timer.dart';
import 'package:lightmeter/screens/timer/event_timer.dart'; import 'package:lightmeter/screens/timer/event_timer.dart';
@ -64,24 +65,11 @@ class _TimerScreenState extends State<TimerScreen> with TickerProviderStateMixin
listenWhen: (previous, current) => previous.runtimeType != current.runtimeType, listenWhen: (previous, current) => previous.runtimeType != current.runtimeType,
listener: (context, state) => _updateAnimations(state), listener: (context, state) => _updateAnimations(state),
child: Scaffold( child: Scaffold(
appBar: AppBar( body: Center(
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( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
TimerMeteringConfig(exposurePair: widget.exposurePair),
const Spacer(), const Spacer(),
Padding( Padding(
padding: const EdgeInsets.all(Dimens.paddingL), padding: const EdgeInsets.all(Dimens.paddingL),
@ -129,7 +117,6 @@ class _TimerScreenState extends State<TimerScreen> with TickerProviderStateMixin
), ),
), ),
), ),
),
); );
} }