diff --git a/lib/entity_widgets/controls/alarm_control_panel_controls.dart b/lib/entity_widgets/controls/alarm_control_panel_controls.dart index 1021976..eeaf873 100644 --- a/lib/entity_widgets/controls/alarm_control_panel_controls.dart +++ b/lib/entity_widgets/controls/alarm_control_panel_controls.dart @@ -37,6 +37,35 @@ class _AlarmControlPanelControlsWidgetWidgetState extends State[ + FlatButton( + child: new Text("Yes"), + onPressed: () { + eventBus.fire(new ServiceCallEvent(entity.domain, "alarm_trigger", entity.entityId, null)); + Navigator.of(context).pop(); + }, + ), + FlatButton( + child: new Text("No"), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } + @override Widget build(BuildContext context) { final entityModel = EntityModel.of(context); @@ -86,84 +115,79 @@ class _AlarmControlPanelControlsWidgetWidgetState extends State[ - Wrap( - spacing: 5.0, - children: [ - RaisedButton( - onPressed: () => _pinPadHandler("1"), - child: Text("1"), - ), - RaisedButton( - onPressed: () => _pinPadHandler("2"), - child: Text("2"), - ), - RaisedButton( - onPressed: () => _pinPadHandler("3"), - child: Text("3"), - ) - ], - ), - Wrap( - spacing: 5.0, - children: [ - RaisedButton( - onPressed: () => _pinPadHandler("4"), - child: Text("4"), - ), - RaisedButton( - onPressed: () => _pinPadHandler("5"), - child: Text("5"), - ), - RaisedButton( - onPressed: () => _pinPadHandler("6"), - child: Text("6"), - ) - ], - ), - Wrap( - spacing: 5.0, - children: [ - RaisedButton( - onPressed: () => _pinPadHandler("7"), - child: Text("7"), - ), - RaisedButton( - onPressed: () => _pinPadHandler("8"), - child: Text("8"), - ), - RaisedButton( - onPressed: () => _pinPadHandler("9"), - child: Text("9"), - ) - ], - ), - Wrap( - spacing: 5.0, - alignment: WrapAlignment.end, - children: [ - RaisedButton( - onPressed: () => _pinPadHandler("0"), - child: Text("0"), - ), - RaisedButton( - onPressed: () => _pinPadClear(), - child: Text("CLEAR"), - ) - ], - ) - ], - ) - ); - } else { - pinPad = Container(); - } + Widget pinPad = Padding( + padding: EdgeInsets.only(bottom: Sizes.rowPadding), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Wrap( + spacing: 5.0, + children: [ + RaisedButton( + onPressed: () => _pinPadHandler("1"), + child: Text("1"), + ), + RaisedButton( + onPressed: () => _pinPadHandler("2"), + child: Text("2"), + ), + RaisedButton( + onPressed: () => _pinPadHandler("3"), + child: Text("3"), + ) + ], + ), + Wrap( + spacing: 5.0, + children: [ + RaisedButton( + onPressed: () => _pinPadHandler("4"), + child: Text("4"), + ), + RaisedButton( + onPressed: () => _pinPadHandler("5"), + child: Text("5"), + ), + RaisedButton( + onPressed: () => _pinPadHandler("6"), + child: Text("6"), + ) + ], + ), + Wrap( + spacing: 5.0, + children: [ + RaisedButton( + onPressed: () => _pinPadHandler("7"), + child: Text("7"), + ), + RaisedButton( + onPressed: () => _pinPadHandler("8"), + child: Text("8"), + ), + RaisedButton( + onPressed: () => _pinPadHandler("9"), + child: Text("9"), + ) + ], + ), + Wrap( + spacing: 5.0, + alignment: WrapAlignment.end, + children: [ + RaisedButton( + onPressed: () => _pinPadHandler("0"), + child: Text("0"), + ), + RaisedButton( + onPressed: () => _pinPadClear(), + child: Text("CLEAR"), + ) + ], + ) + ], + ) + ); Widget inputWrapper = Container( width: 150.0, child: TextField( @@ -193,12 +217,24 @@ class _AlarmControlPanelControlsWidgetWidgetState extends State _askToTrigger(entity), + ) + ] + ); return Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ widget.extended ? buttonsWrapper : inputWrapper, widget.extended ? inputWrapper : buttonsWrapper, - pinPad + widget.extended ? pinPad : triggerButton ] ); diff --git a/lib/ui_widgets/card_widget.dart b/lib/ui_widgets/card_widget.dart index a46dfd8..82697b7 100644 --- a/lib/ui_widgets/card_widget.dart +++ b/lib/ui_widgets/card_widget.dart @@ -144,8 +144,24 @@ class CardWidget extends StatelessWidget { color: Colors.grey ), ), - trailing: EntityIcon( - iconSize: 50.0, + trailing: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + EntityIcon( + iconSize: 50.0, + ), + Container( + width: 26.0, + child: IconButton( + padding: EdgeInsets.all(0.0), + alignment: Alignment.centerRight, + icon: Icon(MaterialDesignIcons.createIconDataFromIconName( + "mdi:dots-vertical")), + onPressed: () => eventBus.fire(new ShowEntityPageEvent(card.linkedEntityWrapper.entity)) + ) + ) + ] ), )); body.add(