Light color button
This commit is contained in:
parent
f29762c931
commit
ce9f25b86c
@ -964,33 +964,24 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
|
|||||||
|
|
||||||
Widget _buildColorControl(LightEntity entity) {
|
Widget _buildColorControl(LightEntity entity) {
|
||||||
if ((entity.supportColor) && (entity.color != null)) {
|
if ((entity.supportColor) && (entity.color != null)) {
|
||||||
Color backColor = Color.fromRGBO(255, 255, 255, 0.0);
|
|
||||||
if ((_tmpColor.red >=228) && (_tmpColor.green >=228) && (_tmpColor.blue >=228)) {
|
|
||||||
backColor = Colors.black12;
|
|
||||||
}
|
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(height: Entity.rowPadding,),
|
Container(height: Entity.rowPadding,),
|
||||||
GestureDetector(
|
RaisedButton(
|
||||||
child: Container(
|
onPressed: () => _showColorPicker(entity),
|
||||||
width: 250.0,
|
color: _tmpColor ?? Colors.black45,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Color",
|
"COLOR",
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 50.0,
|
fontSize: 50.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: _tmpColor ?? Colors.black45,
|
color: Colors.black12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: backColor
|
|
||||||
),
|
),
|
||||||
),
|
Container(height: 2*Entity.rowPadding,),
|
||||||
onTap: () => _showColorPicker(entity),
|
|
||||||
),
|
|
||||||
Container(height: Entity.rowPadding,),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user