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_class/button_entity.class.dart

24 lines
572 B
Dart
Raw Normal View History

part of '../main.dart';
2018-10-02 00:41:40 +03:00
class _ButtonEntityWidgetState extends _EntityWidgetState {
@override
2018-10-02 23:10:40 +03:00
void setNewState(newValue) {
2018-10-02 00:41:40 +03:00
eventBus.fire(new ServiceCallEvent(widget.entity.domain, "turn_on", widget.entity.entityId, null));
}
@override
Widget _buildActionWidget(BuildContext context) {
return FlatButton(
onPressed: (() {
2018-10-02 23:10:40 +03:00
setNewState(null);
}),
child: Text(
"EXECUTE",
textAlign: TextAlign.right,
style:
new TextStyle(fontSize: Entity.STATE_FONT_SIZE, color: Colors.blue),
),
);
}
}