47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
|
part of '../main.dart';
|
||
|
|
||
|
class UnsupportedCard extends StatelessWidget {
|
||
|
final HACard card;
|
||
|
|
||
|
const UnsupportedCard({Key key, this.card}) : super(key: key);
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
List<Widget> body = [];
|
||
|
body.add(
|
||
|
CardHeader(
|
||
|
name: card.name ?? ""
|
||
|
)
|
||
|
);
|
||
|
List<Widget> result = [];
|
||
|
if (card.linkedEntityWrapper != null) {
|
||
|
result.addAll(<Widget>[
|
||
|
Padding(
|
||
|
padding: EdgeInsets.fromLTRB(0.0, Sizes.rowPadding, 0.0, Sizes.rowPadding),
|
||
|
child: EntityModel(
|
||
|
entityWrapper: card.linkedEntityWrapper,
|
||
|
handleTap: true,
|
||
|
child: card.linkedEntityWrapper.entity.buildDefaultWidget(context)
|
||
|
),
|
||
|
)
|
||
|
]);
|
||
|
} else {
|
||
|
result.addAll(<Widget>[
|
||
|
Padding(
|
||
|
padding: EdgeInsets.fromLTRB(Sizes.leftWidgetPadding, Sizes.rowPadding, Sizes.rightWidgetPadding, Sizes.rowPadding),
|
||
|
child: Text("'${card.type}' card is not supported yet"),
|
||
|
),
|
||
|
]);
|
||
|
}
|
||
|
body.addAll(result);
|
||
|
return CardWrapper(
|
||
|
child: new Column(
|
||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||
|
mainAxisSize: MainAxisSize.min,
|
||
|
children: body
|
||
|
)
|
||
|
);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|