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(), width: tickLength(),
), ),
), ),
if (value.stopType != StopType.full) const SizedBox(width: Dimens.grid8),
]; ];
return Row( return Row(
mainAxisAlignment: tickOnTheLeft ? MainAxisAlignment.start : MainAxisAlignment.end, mainAxisAlignment: tickOnTheLeft ? MainAxisAlignment.start : MainAxisAlignment.end,

View file

@ -16,8 +16,12 @@ class ExposurePairsList extends StatelessWidget {
Positioned.fill( Positioned.fill(
child: ListView.builder( child: ListView.builder(
key: ValueKey(exposurePairs.hashCode), key: ValueKey(exposurePairs.hashCode),
padding: const EdgeInsets.all(Dimens.paddingL),
itemCount: exposurePairs.length, itemCount: exposurePairs.length,
itemBuilder: (_, index) => Row( itemBuilder: (_, index) => Stack(
alignment: Alignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
@ -29,7 +33,6 @@ class ExposurePairsList extends StatelessWidget {
), ),
), ),
), ),
const SizedBox(width: Dimens.grid16),
Expanded( Expanded(
child: Align( child: Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
@ -41,16 +44,30 @@ class ExposurePairsList extends StatelessWidget {
), ),
], ],
), ),
),
),
Positioned( Positioned(
top: 0, top: 0,
bottom: 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( child: ColoredBox(
color: Theme.of(context).colorScheme.onBackground, color: Theme.of(context).colorScheme.onBackground,
child: const SizedBox(width: 1), child: const SizedBox(width: 1),
), ),
), ),
),
),
),
],
),
),
),
], ],
); );
} }