added bottom controls (wip)

This commit is contained in:
Vadim 2022-10-29 14:01:15 +03:00
parent 2be18d9c01
commit 54ad2a1461
4 changed files with 85 additions and 2 deletions

View file

@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:lightmeter/res/dimens.dart';
import 'components/measure_button.dart';
import 'components/side_buttons.dart';
class MeteringBottomControls extends StatelessWidget {
final VoidCallback onSourceChanged;
final VoidCallback onMeasure;
final VoidCallback onSettings;
const MeteringBottomControls({
required this.onSourceChanged,
required this.onMeasure,
required this.onSettings,
super.key,
});
@override
Widget build(BuildContext context) {
return ColoredBox(
color: Theme.of(context).colorScheme.surface,
child: SafeArea(
top: false,
child: Padding(
padding: const EdgeInsets.all(Dimens.paddingM),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
MeteringBottomControlsSideButton(
onPressed: onSourceChanged,
icon: Icons.flip_camera_android,
),
MeteringMeasureButton(
onTap: onMeasure,
),
MeteringBottomControlsSideButton(
onPressed: onSettings,
icon: Icons.settings,
),
],
),
),
),
);
}
}

View file

@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:lightmeter/screens/metering/components/shared/filled_circle.dart';
class MeteringBottomControlsSideButton extends StatelessWidget {
final IconData icon;
final VoidCallback onPressed;
const MeteringBottomControlsSideButton({
required this.icon,
required this.onPressed,
super.key,
});
@override
Widget build(BuildContext context) {
return FilledCircle(
color: Theme.of(context).colorScheme.surfaceVariant,
size: 48,
child: Center(
child: IconButton(
onPressed: onPressed,
color: Theme.of(context).colorScheme.onSurface,
icon: Icon(icon),
),
),
);
}
}

View file

@ -18,7 +18,10 @@ class FilledCircle extends StatelessWidget {
borderRadius: BorderRadius.circular(size / 2), borderRadius: BorderRadius.circular(size / 2),
child: SizedBox.fromSize( child: SizedBox.fromSize(
size: Size.square(size), size: Size.square(size),
child: ColoredBox(color: color), child: ColoredBox(
color: color,
child: child,
),
), ),
); );
} }

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:lightmeter/models/photography_value.dart'; import 'package:lightmeter/models/photography_value.dart';
import 'components/bottom_controls/bottom_controls.dart';
import 'components/exposure_pairs_list/exposure_pairs_list.dart'; import 'components/exposure_pairs_list/exposure_pairs_list.dart';
import 'components/topbar/topbar.dart'; import 'components/topbar/topbar.dart';
@ -15,7 +16,6 @@ class MeteringScreen extends StatelessWidget {
body: Column( body: Column(
children: [ children: [
const MeteringTopBar( const MeteringTopBar(
lux: 283,
ev: ev, ev: ev,
iso: 6400, iso: 6400,
nd: 0, nd: 0,
@ -26,6 +26,11 @@ class MeteringScreen extends StatelessWidget {
stopType: Stop.third, stopType: Stop.third,
), ),
), ),
MeteringBottomControls(
onSourceChanged: () {},
onMeasure: () {},
onSettings: () {},
),
], ],
), ),
); );