Improve Horizontal and Vertical stack building
This commit is contained in:
@ -82,20 +82,15 @@ class CardWidget extends StatelessWidget {
|
|||||||
case CardType.HORIZONTAL_STACK: {
|
case CardType.HORIZONTAL_STACK: {
|
||||||
if (card.childCards.isNotEmpty) {
|
if (card.childCards.isNotEmpty) {
|
||||||
List<Widget> children = [];
|
List<Widget> children = [];
|
||||||
card.childCards.forEach((card) {
|
children = card.childCards.map((childCard) => Flexible(
|
||||||
if (card.getEntitiesToShow().isNotEmpty || card.showEmpty) {
|
|
||||||
children.add(
|
|
||||||
Flexible(
|
|
||||||
fit: FlexFit.tight,
|
fit: FlexFit.tight,
|
||||||
child: card.build(context),
|
child: childCard.build(context),
|
||||||
)
|
)
|
||||||
);
|
).toList();
|
||||||
}
|
|
||||||
});
|
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: children,
|
children: children,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -104,12 +99,7 @@ class CardWidget extends StatelessWidget {
|
|||||||
|
|
||||||
case CardType.VERTICAL_STACK: {
|
case CardType.VERTICAL_STACK: {
|
||||||
if (card.childCards.isNotEmpty) {
|
if (card.childCards.isNotEmpty) {
|
||||||
List<Widget> children = [];
|
List<Widget> children = card.childCards.map((childCard) => childCard.build(context)).toList();
|
||||||
card.childCards.forEach((card) {
|
|
||||||
children.add(
|
|
||||||
card.build(context)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
Reference in New Issue
Block a user