Fix panel view scroll issue

This commit is contained in:
Yegor Vialov
2020-05-22 12:54:39 +00:00
parent dbeda6ea68
commit a6d1baca77
2 changed files with 19 additions and 20 deletions

View File

@ -14,8 +14,8 @@ class LightCard extends StatefulWidget {
class _LightCardState extends State<LightCard> {
double _newBrightness;
double _actualBrightness;
double _newBrightness;
bool _changedHere = false;
@override
@ -51,8 +51,9 @@ class _LightCardState extends State<LightCard> {
entityWrapper.displayName;
entityWrapper.overrideIcon = widget.card.icon ??
entityWrapper.icon;
_actualBrightness = (entity.brightness ?? 0).toDouble();
if (!_changedHere) {
_actualBrightness = (entity.brightness ?? 0).toDouble();
_newBrightness = _actualBrightness;
} else {
_changedHere = false;
@ -62,8 +63,9 @@ class _LightCardState extends State<LightCard> {
if (lightColor != null && lightColor != Colors.white) {
color = lightColor;
} else {
color = HAClientTheme().getOnStateColor(context);
color = Theme.of(context).accentColor;
}
return CardWrapper(
padding: EdgeInsets.all(4),
child: EntityModel(