diff --git a/lib/entity_widgets/controls/alarm_control_panel_controls.dart b/lib/entity_widgets/controls/alarm_control_panel_controls.dart index 7d2c960..6964911 100644 --- a/lib/entity_widgets/controls/alarm_control_panel_controls.dart +++ b/lib/entity_widgets/controls/alarm_control_panel_controls.dart @@ -123,99 +123,109 @@ 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"), - ) - ], - ) - ], - ) - ); - Widget inputWrapper = Container( - width: 150.0, - child: TextField( - decoration: InputDecoration( - labelText: "Alarm Code" - ), - //focusNode: _focusNode, - obscureText: true, - controller: new TextEditingController.fromValue( - new TextEditingValue( - text: code, - selection: - new TextSelection.collapsed(offset: code.length) - ) - ), - onChanged: (value) { - code = value; - } - ) - ); + Widget pinPad; + if (entity.attributes["code_format"] == null) { + pinPad = Container(width: 0.0, height: 0.0,); + } else { + 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; + if (entity.attributes["code_format"] == null) { + inputWrapper = Container(width: 0.0, height: 0.0,); + } else { + inputWrapper = Container( + width: 150.0, + child: TextField( + decoration: InputDecoration( + labelText: "Alarm Code" + ), + //focusNode: _focusNode, + obscureText: true, + controller: new TextEditingController.fromValue( + new TextEditingValue( + text: code, + selection: + new TextSelection.collapsed(offset: code.length) + ) + ), + onChanged: (value) { + code = value; + } + ) + ); + } Widget buttonsWrapper = Padding( padding: EdgeInsets.symmetric(vertical: Sizes.rowPadding), child: Wrap(