This repository has been archived on 2023-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
ha_client/lib/cards/horizontal_srack_card.dart

30 lines
792 B
Dart
Raw Normal View History

2020-04-25 20:38:21 +03:00
part of '../main.dart';
class HorizontalStackCard extends StatelessWidget {
2020-04-27 01:46:37 +03:00
final HorizontalStackCardData card;
2020-04-25 20:38:21 +03:00
const HorizontalStackCard({Key key, this.card}) : super(key: key);
@override
Widget build(BuildContext context) {
if (card.childCards.isNotEmpty) {
List<Widget> children = [];
children = card.childCards.map((childCard) => Flexible(
fit: FlexFit.tight,
2020-04-27 01:46:37 +03:00
child: childCard.buildCardWidget()
2020-04-25 20:38:21 +03:00
)
).toList();
return IntrinsicHeight(
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: children,
),
);
}
return Container(height: 0.0, width: 0.0,);
}
}