m3_lightmeter/lib/screens/metering/components/exposure_pairs_list/exposure_pairs_list.dart

58 lines
1.8 KiB
Dart
Raw Normal View History

2022-10-26 19:49:21 +00:00
import 'package:flutter/material.dart';
2022-10-29 18:02:45 +00:00
import 'package:lightmeter/models/exposure_pair.dart';
2022-10-26 19:49:21 +00:00
import 'package:lightmeter/res/dimens.dart';
import 'package:lightmeter/screens/metering/components/exposure_pairs_list/components/exposure_pair_item.dart';
class ExposurePairsList extends StatelessWidget {
2022-10-29 18:02:45 +00:00
final List<ExposurePair> exposurePairs;
2022-10-26 19:49:21 +00:00
2022-10-29 18:02:45 +00:00
const ExposurePairsList(this.exposurePairs, {super.key});
2022-10-26 19:49:21 +00:00
@override
Widget build(BuildContext context) {
return Stack(
alignment: Alignment.center,
children: [
Positioned.fill(
child: ListView.builder(
2022-10-29 18:02:45 +00:00
key: ValueKey(exposurePairs.hashCode),
itemCount: exposurePairs.length,
2022-10-26 19:49:21 +00:00
itemBuilder: (_, index) => Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: ExposurePaitListItem(
2022-10-29 18:02:45 +00:00
exposurePairs[index].aperture,
2022-10-26 19:49:21 +00:00
tickOnTheLeft: false,
),
),
),
const SizedBox(width: Dimens.grid16),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: ExposurePaitListItem(
2022-10-29 18:02:45 +00:00
exposurePairs[index].shutterSpeed,
2022-10-26 19:49:21 +00:00
tickOnTheLeft: true,
),
),
),
],
),
),
),
Positioned(
top: 0,
bottom: 0,
child: ColoredBox(
color: Theme.of(context).colorScheme.onBackground,
child: const SizedBox(width: 1),
),
),
],
);
}
}