Resolves #120 Horizontal Stack Cards
This commit is contained in:
@ -2,6 +2,7 @@ part of '../main.dart';
|
||||
|
||||
class HACard {
|
||||
List<EntityWrapper> entities = [];
|
||||
List<HACard> childCards = [];
|
||||
EntityWrapper linkedEntityWrapper;
|
||||
String name;
|
||||
String id;
|
||||
@ -47,6 +48,27 @@ class HACard {
|
||||
);
|
||||
}
|
||||
|
||||
case CardType.horizontalStack: {
|
||||
if (childCards.isNotEmpty) {
|
||||
List<Widget> children = [];
|
||||
childCards.forEach((card) {
|
||||
children.add(
|
||||
Flexible(
|
||||
fit: FlexFit.tight,
|
||||
child: card.build(context),
|
||||
)
|
||||
);
|
||||
});
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: children,
|
||||
);
|
||||
}
|
||||
return Container(height: 0.0, width: 0.0,);
|
||||
}
|
||||
|
||||
case CardType.weatherForecast:
|
||||
case CardType.thermostat:
|
||||
case CardType.sensor:
|
||||
|
@ -3,6 +3,7 @@ part of '../main.dart';
|
||||
class Sizes {
|
||||
static const rightWidgetPadding = 14.0;
|
||||
static const leftWidgetPadding = 8.0;
|
||||
static const buttonPadding = 4.0;
|
||||
static const extendedWidgetHeight = 50.0;
|
||||
static const iconSize = 28.0;
|
||||
static const largeIconSize = 46.0;
|
||||
|
Reference in New Issue
Block a user