2022-10-24 20:25:38 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-10-29 18:02:45 +00:00
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
import 'package:lightmeter/res/dimens.dart';
|
|
|
|
import 'package:lightmeter/screens/metering/metering_event.dart';
|
2022-10-24 20:25:38 +00:00
|
|
|
|
2022-10-29 11:01:15 +00:00
|
|
|
import 'components/bottom_controls/bottom_controls.dart';
|
2022-10-26 19:49:21 +00:00
|
|
|
import 'components/exposure_pairs_list/exposure_pairs_list.dart';
|
2022-10-24 20:25:38 +00:00
|
|
|
import 'components/topbar/topbar.dart';
|
2022-10-29 18:02:45 +00:00
|
|
|
import 'metering_bloc.dart';
|
|
|
|
import 'metering_state.dart';
|
2022-10-24 20:25:38 +00:00
|
|
|
|
|
|
|
class MeteringScreen extends StatelessWidget {
|
|
|
|
const MeteringScreen({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: Theme.of(context).colorScheme.background,
|
2022-10-29 18:02:45 +00:00
|
|
|
body: BlocBuilder<MeteringBloc, MeteringState>(
|
|
|
|
builder: (context, state) {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
MeteringTopBar(
|
|
|
|
fastest: state.fastest,
|
|
|
|
slowest: state.slowest,
|
|
|
|
ev: state.ev,
|
|
|
|
iso: state.iso,
|
|
|
|
nd: state.nd,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
flex: 2,
|
|
|
|
child: ExposurePairsList(state.exposurePairs),
|
|
|
|
),
|
|
|
|
const SizedBox(width: Dimens.grid16),
|
|
|
|
const Spacer()
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
MeteringBottomControls(
|
|
|
|
onSourceChanged: () {},
|
|
|
|
onMeasure: () => context.read<MeteringBloc>().add(const MeasureEvent()),
|
|
|
|
onSettings: () {},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
},
|
2022-10-24 20:25:38 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|