removed LUX from topbar

This commit is contained in:
Vadim 2022-10-29 14:04:46 +03:00
parent 54ad2a1461
commit 3c1f803e25

View file

@ -7,13 +7,11 @@ import 'package:lightmeter/utils/text_line_height.dart';
class MeteringTopBar extends StatelessWidget { class MeteringTopBar extends StatelessWidget {
static const _columnsCount = 3; static const _columnsCount = 3;
final double lux;
final double ev; final double ev;
final int iso; final int iso;
final double nd; final double nd;
const MeteringTopBar({ const MeteringTopBar({
required this.lux,
required this.ev, required this.ev,
required this.iso, required this.iso,
required this.nd, required this.nd,
@ -22,31 +20,23 @@ class MeteringTopBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final columnWidth = (MediaQuery.of(context).size.width - Dimens.paddingM * (_columnsCount + 1)) / 3; final columnWidth =
return CustomPaint( (MediaQuery.of(context).size.width - Dimens.paddingM * 2 - Dimens.grid16 * (_columnsCount - 1)) / 3;
painter: TopBarShape( return ColoredBox(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
appendixSize: Size(
(MediaQuery.of(context).size.width - Dimens.paddingM * 4) / 3 + Dimens.paddingM * 2,
Dimens.paddingM +
Theme.of(context).textTheme.labelMedium!.lineHeight +
Dimens.grid4 +
Theme.of(context).textTheme.titleLarge!.lineHeight +
Dimens.paddingM * 2,
),
),
child: Padding( child: Padding(
padding: const EdgeInsets.all(Dimens.paddingM), padding: const EdgeInsets.all(Dimens.paddingM),
child: SafeArea( child: SafeArea(
bottom: false, bottom: false,
child: Column( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
IntrinsicHeight( Expanded(
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Expanded( SizedBox(
height: columnWidth / 3 * 4,
child: ReadingContainer( child: ReadingContainer(
values: const [ values: const [
ReadingValue( ReadingValue(
@ -61,32 +51,8 @@ class MeteringTopBar extends StatelessWidget {
), ),
), ),
const _InnerPadding(), const _InnerPadding(),
SizedBox(
width: columnWidth,
child: ClipRRect(
borderRadius: BorderRadius.circular(Dimens.borderRadiusM),
child: const AspectRatio(
aspectRatio: 3 / 4,
child: ColoredBox(color: Colors.black),
),
),
)
],
),
),
const _InnerPadding(),
Row( Row(
children: [ children: [
SizedBox(
width: columnWidth,
child: ReadingContainer.singleValue(
value: ReadingValue(
label: 'LUX',
value: lux.toString(),
),
),
),
const _InnerPadding(),
SizedBox( SizedBox(
width: columnWidth, width: columnWidth,
child: ReadingContainer.singleValue( child: ReadingContainer.singleValue(
@ -107,25 +73,33 @@ class MeteringTopBar extends StatelessWidget {
), ),
), ),
], ],
)
],
),
), ),
const _InnerPadding(),
Row(
children: [
const Spacer(),
const _InnerPadding(),
const Spacer(),
const _InnerPadding(), const _InnerPadding(),
SizedBox( SizedBox(
width: columnWidth, width: columnWidth,
child: ReadingContainer.singleValue( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(Dimens.borderRadiusM),
child: const AspectRatio(
aspectRatio: 3 / 4,
child: ColoredBox(color: Colors.black),
),
),
const _InnerPadding(),
ReadingContainer.singleValue(
value: ReadingValue( value: ReadingValue(
label: 'ND', label: 'ND',
value: nd.toString(), value: nd.toString(),
), ),
), ),
),
], ],
), ),
),
], ],
), ),
), ),
@ -135,5 +109,5 @@ class MeteringTopBar extends StatelessWidget {
} }
class _InnerPadding extends SizedBox { class _InnerPadding extends SizedBox {
const _InnerPadding() : super(height: Dimens.paddingM, width: Dimens.borderRadiusM); const _InnerPadding() : super(height: Dimens.grid16, width: Dimens.grid16);
} }