Prettified ExposurePairsList ruler

This commit is contained in:
Vadim 2022-12-17 00:25:08 +03:00
parent ca8c1f8e4d
commit fb0923903a
2 changed files with 42 additions and 24 deletions

View file

@ -23,6 +23,7 @@ class ExposurePaitListItem<T extends PhotographyStopValue> extends StatelessWidg
width: tickLength(),
),
),
if (value.stopType != StopType.full) const SizedBox(width: Dimens.grid8),
];
return Row(
mainAxisAlignment: tickOnTheLeft ? MainAxisAlignment.start : MainAxisAlignment.end,

View file

@ -16,26 +16,51 @@ class ExposurePairsList extends StatelessWidget {
Positioned.fill(
child: ListView.builder(
key: ValueKey(exposurePairs.hashCode),
padding: const EdgeInsets.all(Dimens.paddingL),
itemCount: exposurePairs.length,
itemBuilder: (_, index) => Row(
mainAxisAlignment: MainAxisAlignment.center,
itemBuilder: (_, index) => Stack(
alignment: Alignment.center,
children: [
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: ExposurePaitListItem(
exposurePairs[index].aperture,
tickOnTheLeft: false,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: ExposurePaitListItem(
exposurePairs[index].aperture,
tickOnTheLeft: false,
),
),
),
),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: ExposurePaitListItem(
exposurePairs[index].shutterSpeed,
tickOnTheLeft: true,
),
),
),
],
),
const SizedBox(width: Dimens.grid16),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: ExposurePaitListItem(
exposurePairs[index].shutterSpeed,
tickOnTheLeft: true,
Positioned(
top: 0,
bottom: 0,
child: LayoutBuilder(
builder: (context, constraints) => Align(
alignment: index == 0
? Alignment.bottomCenter
: (index == exposurePairs.length - 1 ? Alignment.topCenter : Alignment.center),
child: SizedBox(
height: index == 0 || index == exposurePairs.length - 1
? constraints.maxHeight / 2
: constraints.maxHeight,
child: ColoredBox(
color: Theme.of(context).colorScheme.onBackground,
child: const SizedBox(width: 1),
),
),
),
),
),
@ -43,14 +68,6 @@ class ExposurePairsList extends StatelessWidget {
),
),
),
Positioned(
top: 0,
bottom: 0,
child: ColoredBox(
color: Theme.of(context).colorScheme.onBackground,
child: const SizedBox(width: 1),
),
),
],
);
}