This repository has been archived on 2025-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
ha_client/lib/entity_widgets/entity_name.dart
Yegor Vialov 25bf10a64e WIP #183
2018-11-14 19:52:17 +02:00

28 lines
745 B
Dart

part of '../main.dart';
class EntityName extends StatelessWidget {
final EdgeInsetsGeometry padding;
const EntityName({Key key, this.padding: const EdgeInsets.only(right: 10.0)}) : super(key: key);
@override
Widget build(BuildContext context) {
final entityModel = EntityModel.of(context);
return GestureDetector(
child: Padding(
padding: padding,
child: Text(
"${entityModel.entity.displayName}",
overflow: TextOverflow.ellipsis,
softWrap: true,
style: TextStyle(fontSize: Sizes.nameFontSize),
),
),
onTap: () =>
entityModel.handleTap
? eventBus.fire(new ShowEntityPageEvent(entityModel.entity))
: null,
);
}
}