This commit is contained in:
Yegor Vialov
2018-11-14 12:35:08 +02:00
parent 8a9641fbed
commit 86b6ad6bba
3 changed files with 19 additions and 12 deletions

View File

@ -56,6 +56,10 @@ class Entity {
domain = rawData["entity_id"].split(".")[0];
entityId = rawData["entity_id"];
state = rawData["state"];
if (domain == "sun") {
state = "iuwfhiwushf iwuwfhiuwefh dsjhfkjsdfnksdj nfksdjfn ksdjfn kdsjfndskj sdk fhksbsk jvfk jvsfkj sfkjvsfkvdsjk bvsfk svfjk";
attributes["friendly_name"] = "Black hole sun, wan't you come, wan't you come";
}
assumedState = state;
_lastUpdated = DateTime.tryParse(rawData["last_updated"]);
}

View File

@ -10,16 +10,15 @@ class DefaultEntityContainer extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
child: Row(
children: <Widget>[
EntityIcon(),
Expanded(
child: EntityName(),
),
state
],
),
return Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
EntityIcon(),
Expanded(
child: EntityName(),
),
state
],
);
}
}

View File

@ -15,6 +15,9 @@ class SimpleEntityState extends StatelessWidget {
child: Text(
"${entityModel.entity.state}${entityModel.entity.unitOfMeasurement}",
textAlign: TextAlign.right,
maxLines: 4,
overflow: TextOverflow.ellipsis,
softWrap: true,
style: new TextStyle(
fontSize: Sizes.stateFontSize,
)),
@ -24,8 +27,9 @@ class SimpleEntityState extends StatelessWidget {
)
);
if (expanded) {
return Expanded(
child: result
return SizedBox(
width: MediaQuery.of(context).size.width * 0.3,
child: result,
);
} else {
return result;