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/entity_widgets/entity_icon.dart

22 lines
660 B
Dart
Raw Normal View History

2018-10-27 14:27:41 +03:00
part of '../main.dart';
class EntityIcon extends StatelessWidget {
@override
Widget build(BuildContext context) {
final entityModel = EntityModel.of(context);
return GestureDetector(
child: Padding(
padding: EdgeInsets.fromLTRB(
2018-11-12 20:28:10 +02:00
Sizes.leftWidgetPadding, 0.0, 12.0, 0.0),
2018-10-27 14:27:41 +03:00
child: MaterialDesignIcons.createIconWidgetFromEntityData(
entityModel.entity,
2018-11-12 20:28:10 +02:00
Sizes.iconSize,
2018-11-14 15:14:46 +02:00
EntityColor.stateColor(entityModel.entity.state)
2018-10-28 18:07:52 +02:00
),
2018-10-27 14:27:41 +03:00
),
onTap: () => entityModel.handleTap
? eventBus.fire(new ShowEntityPageEvent(entityModel.entity))
: null,
);
}
}