Fix panel view scroll issue
This commit is contained in:
@ -14,8 +14,8 @@ class LightCard extends StatefulWidget {
|
|||||||
|
|
||||||
class _LightCardState extends State<LightCard> {
|
class _LightCardState extends State<LightCard> {
|
||||||
|
|
||||||
double _newBrightness;
|
|
||||||
double _actualBrightness;
|
double _actualBrightness;
|
||||||
|
double _newBrightness;
|
||||||
bool _changedHere = false;
|
bool _changedHere = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -51,8 +51,9 @@ class _LightCardState extends State<LightCard> {
|
|||||||
entityWrapper.displayName;
|
entityWrapper.displayName;
|
||||||
entityWrapper.overrideIcon = widget.card.icon ??
|
entityWrapper.overrideIcon = widget.card.icon ??
|
||||||
entityWrapper.icon;
|
entityWrapper.icon;
|
||||||
_actualBrightness = (entity.brightness ?? 0).toDouble();
|
|
||||||
if (!_changedHere) {
|
if (!_changedHere) {
|
||||||
|
_actualBrightness = (entity.brightness ?? 0).toDouble();
|
||||||
_newBrightness = _actualBrightness;
|
_newBrightness = _actualBrightness;
|
||||||
} else {
|
} else {
|
||||||
_changedHere = false;
|
_changedHere = false;
|
||||||
@ -62,8 +63,9 @@ class _LightCardState extends State<LightCard> {
|
|||||||
if (lightColor != null && lightColor != Colors.white) {
|
if (lightColor != null && lightColor != Colors.white) {
|
||||||
color = lightColor;
|
color = lightColor;
|
||||||
} else {
|
} else {
|
||||||
color = HAClientTheme().getOnStateColor(context);
|
color = Theme.of(context).accentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CardWrapper(
|
return CardWrapper(
|
||||||
padding: EdgeInsets.all(4),
|
padding: EdgeInsets.all(4),
|
||||||
child: EntityModel(
|
child: EntityModel(
|
||||||
|
@ -10,15 +10,12 @@ class ViewWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (this.view.isPanel) {
|
|
||||||
return FractionallySizedBox(
|
|
||||||
widthFactor: 1,
|
|
||||||
heightFactor: 1,
|
|
||||||
child: _buildPanelChild(context),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
Widget cardsContainer;
|
Widget cardsContainer;
|
||||||
Widget badgesContainer;
|
Widget badgesContainer;
|
||||||
|
if (this.view.isPanel) {
|
||||||
|
cardsContainer = _buildPanelChild(context);
|
||||||
|
badgesContainer = Container(width: 0, height: 0);
|
||||||
|
} else {
|
||||||
if (this.view.badges != null && this.view.badges is BadgesData) {
|
if (this.view.badges != null && this.view.badges is BadgesData) {
|
||||||
badgesContainer = this.view.badges.buildCardWidget();
|
badgesContainer = this.view.badges.buildCardWidget();
|
||||||
} else {
|
} else {
|
||||||
@ -50,6 +47,7 @@ class ViewWidget extends StatelessWidget {
|
|||||||
} else {
|
} else {
|
||||||
cardsContainer = Container();
|
cardsContainer = Container();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
padding: EdgeInsets.all(0),
|
padding: EdgeInsets.all(0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -61,7 +59,6 @@ class ViewWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildPanelChild(BuildContext context) {
|
Widget _buildPanelChild(BuildContext context) {
|
||||||
if (this.view.cards != null && this.view.cards.isNotEmpty) {
|
if (this.view.cards != null && this.view.cards.isNotEmpty) {
|
||||||
|
Reference in New Issue
Block a user