Code structure

This commit is contained in:
Yegor Vialov
2018-10-27 14:27:41 +03:00
parent df56f6ceda
commit 9edfec7dff
39 changed files with 2535 additions and 2474 deletions

View File

@ -0,0 +1,24 @@
part of '../../main.dart';
class ButtonStateWidget extends StatelessWidget {
void _setNewState(Entity entity) {
eventBus.fire(new ServiceCallEvent(entity.domain, "turn_on", entity.entityId, null));
}
@override
Widget build(BuildContext context) {
final entityModel = EntityModel.of(context);
return FlatButton(
onPressed: (() {
_setNewState(entityModel.entity);
}),
child: Text(
"EXECUTE",
textAlign: TextAlign.right,
style:
new TextStyle(fontSize: Entity.stateFontSize, color: Colors.blue),
),
);
}
}