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/widgets/card_header.widget.dart

29 lines
733 B
Dart
Raw Normal View History

part of '../../main.dart';
2019-09-07 18:23:04 +03:00
class CardHeader extends StatelessWidget {
final String name;
2019-01-29 15:00:15 +02:00
final Widget trailing;
final Widget subtitle;
2019-09-07 18:23:04 +03:00
const CardHeader({Key key, this.name, this.trailing, this.subtitle}) : super(key: key);
@override
Widget build(BuildContext context) {
var result;
if ((name != null) && (name.trim().length > 0)) {
result = new ListTile(
2019-01-29 15:00:15 +02:00
trailing: trailing,
subtitle: subtitle,
title: Text("$name",
textAlign: TextAlign.left,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.headline),
);
} else {
2020-04-25 18:59:07 +03:00
result = new Container(width: 0.0, height: Sizes.rowPadding);
}
return result;
}
}