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/markdown_card.dart

33 lines
921 B
Dart
Raw Normal View History

2020-04-25 20:38:21 +03:00
part of '../main.dart';
class MarkdownCard extends StatelessWidget {
2020-04-27 01:46:37 +03:00
final MarkdownCardData card;
2020-04-25 20:38:21 +03:00
const MarkdownCard({Key key, this.card}) : super(key: key);
@override
Widget build(BuildContext context) {
if (card.content == null) {
return Container(height: 0.0, width: 0.0,);
} else if (card.content == '***') {
return Container(height: Sizes.rowPadding, width: 0.0,);
2020-04-25 20:38:21 +03:00
}
return CardWrapper(
child: Padding(
padding: EdgeInsets.fromLTRB(Sizes.leftWidgetPadding, Sizes.rowPadding, Sizes.rightWidgetPadding, Sizes.rowPadding),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
2020-04-27 01:46:37 +03:00
CardHeader(name: card.title),
2020-04-25 20:38:21 +03:00
MarkdownBody(
data: card.content,
)
],
),
)
);
}
}