mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-21 23:10:40 +00:00
added bottom controls (wip)
This commit is contained in:
parent
2be18d9c01
commit
54ad2a1461
4 changed files with 85 additions and 2 deletions
|
@ -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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -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),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue