diff --git a/lib/screens/metering/components/bottom_controls/bottom_controls.dart b/lib/screens/metering/components/bottom_controls/bottom_controls.dart new file mode 100644 index 0000000..9265368 --- /dev/null +++ b/lib/screens/metering/components/bottom_controls/bottom_controls.dart @@ -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, + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/metering/components/bottom_controls/components/side_buttons.dart b/lib/screens/metering/components/bottom_controls/components/side_buttons.dart new file mode 100644 index 0000000..958498b --- /dev/null +++ b/lib/screens/metering/components/bottom_controls/components/side_buttons.dart @@ -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), + ), + ), + ); + } +} diff --git a/lib/screens/metering/components/shared/filled_circle.dart b/lib/screens/metering/components/shared/filled_circle.dart index 2eb1a2e..2ad262a 100644 --- a/lib/screens/metering/components/shared/filled_circle.dart +++ b/lib/screens/metering/components/shared/filled_circle.dart @@ -18,7 +18,10 @@ class FilledCircle extends StatelessWidget { borderRadius: BorderRadius.circular(size / 2), child: SizedBox.fromSize( size: Size.square(size), - child: ColoredBox(color: color), + child: ColoredBox( + color: color, + child: child, + ), ), ); } diff --git a/lib/screens/metering/metering_screen.dart b/lib/screens/metering/metering_screen.dart index 2a0dfa9..d13cf20 100644 --- a/lib/screens/metering/metering_screen.dart +++ b/lib/screens/metering/metering_screen.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.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/topbar/topbar.dart'; @@ -15,7 +16,6 @@ class MeteringScreen extends StatelessWidget { body: Column( children: [ const MeteringTopBar( - lux: 283, ev: ev, iso: 6400, nd: 0, @@ -26,6 +26,11 @@ class MeteringScreen extends StatelessWidget { stopType: Stop.third, ), ), + MeteringBottomControls( + onSourceChanged: () {}, + onMeasure: () {}, + onSettings: () {}, + ), ], ), );