Fix 'Paste color' button background when saved color is null

This commit is contained in:
estevez-dev 2019-03-10 23:49:05 +02:00
parent 4f4ac3b574
commit 0ef2ebfe31

View File

@ -179,9 +179,7 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
color: _tmpColor, color: _tmpColor,
onColorSelected: (color) => _setColor(entity, color), onColorSelected: (color) => _setColor(entity, color),
), ),
Padding( Row(
padding: EdgeInsets.only(top: 0.0),
child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
FlatButton( FlatButton(
@ -197,7 +195,7 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
}, },
), ),
FlatButton( FlatButton(
color: savedColor.toColor(), color: savedColor?.toColor() ?? Colors.transparent,
child: Text('Paste color'), child: Text('Paste color'),
onPressed: savedColor == null ? null : () { onPressed: savedColor == null ? null : () {
_setColor(entity, savedColor); _setColor(entity, savedColor);
@ -205,7 +203,6 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
) )
], ],
) )
)
], ],
); );
} else { } else {