This commit is contained in:
Yegor Vialov
2019-01-25 23:08:12 +02:00
parent 2a45758a6d
commit a2836a3603

View File

@ -296,10 +296,8 @@ class _ClimateControlWidgetState extends State<ClimateControlWidget> {
TemperatureControlWidget( TemperatureControlWidget(
value: _tmpTemperature, value: _tmpTemperature,
fontColor: _showPending ? Colors.red : Colors.black, fontColor: _showPending ? Colors.red : Colors.black,
onLargeDec: () => _temperatureDown(entity, 0.5), onDec: () => _temperatureDown(entity, 0.5),
onLargeInc: () => _temperatureUp(entity, 0.5), onInc: () => _temperatureUp(entity, 0.5),
onSmallDec: () => _temperatureDown(entity, 0.1),
onSmallInc: () => _temperatureUp(entity, 0.1),
) )
], ],
); );
@ -315,10 +313,8 @@ class _ClimateControlWidgetState extends State<ClimateControlWidget> {
TemperatureControlWidget( TemperatureControlWidget(
value: _tmpTargetLow, value: _tmpTargetLow,
fontColor: _showPending ? Colors.red : Colors.black, fontColor: _showPending ? Colors.red : Colors.black,
onLargeDec: () => _targetLowDown(entity, 0.5), onDec: () => _targetLowDown(entity, 0.5),
onLargeInc: () => _targetLowUp(entity, 0.5), onInc: () => _targetLowUp(entity, 0.5),
onSmallDec: () => _targetLowDown(entity, 0.1),
onSmallInc: () => _targetLowUp(entity, 0.1),
), ),
Expanded( Expanded(
child: Container(height: 10.0), child: Container(height: 10.0),
@ -330,10 +326,8 @@ class _ClimateControlWidgetState extends State<ClimateControlWidget> {
TemperatureControlWidget( TemperatureControlWidget(
value: _tmpTargetHigh, value: _tmpTargetHigh,
fontColor: _showPending ? Colors.red : Colors.black, fontColor: _showPending ? Colors.red : Colors.black,
onLargeDec: () => _targetHighDown(entity, 0.5), onDec: () => _targetHighDown(entity, 0.5),
onLargeInc: () => _targetHighUp(entity, 0.5), onInc: () => _targetHighUp(entity, 0.5),
onSmallDec: () => _targetHighDown(entity, 0.1),
onSmallInc: () => _targetHighUp(entity, 0.1),
) )
); );
} }
@ -419,18 +413,14 @@ class TemperatureControlWidget extends StatelessWidget {
final double value; final double value;
final double fontSize; final double fontSize;
final Color fontColor; final Color fontColor;
final onSmallInc; final onInc;
final onLargeInc; final onDec;
final onSmallDec;
final onLargeDec;
TemperatureControlWidget( TemperatureControlWidget(
{Key key, {Key key,
@required this.value, @required this.value,
@required this.onSmallInc, @required this.onInc,
@required this.onSmallDec, @required this.onDec,
@required this.onLargeInc,
@required this.onLargeDec,
this.fontSize, this.fontSize,
this.fontColor}) this.fontColor})
: super(key: key); : super(key: key);
@ -453,29 +443,13 @@ class TemperatureControlWidget extends StatelessWidget {
icon: Icon(MaterialDesignIcons.createIconDataFromIconName( icon: Icon(MaterialDesignIcons.createIconDataFromIconName(
'mdi:chevron-up')), 'mdi:chevron-up')),
iconSize: 30.0, iconSize: 30.0,
onPressed: () => onSmallInc(), onPressed: () => onInc(),
), ),
IconButton( IconButton(
icon: Icon(MaterialDesignIcons.createIconDataFromIconName( icon: Icon(MaterialDesignIcons.createIconDataFromIconName(
'mdi:chevron-down')), 'mdi:chevron-down')),
iconSize: 30.0, iconSize: 30.0,
onPressed: () => onSmallDec(), onPressed: () => onDec(),
)
],
),
Column(
children: <Widget>[
IconButton(
icon: Icon(MaterialDesignIcons.createIconDataFromIconName(
'mdi:chevron-double-up')),
iconSize: 30.0,
onPressed: () => onLargeInc(),
),
IconButton(
icon: Icon(MaterialDesignIcons.createIconDataFromIconName(
'mdi:chevron-double-down')),
iconSize: 30.0,
onPressed: () => onLargeDec(),
) )
], ],
) )