This commit is contained in:
estevez-dev
2019-05-09 13:16:35 +03:00
parent 277c67fc6f
commit 14cc55a2c7
4 changed files with 16 additions and 16 deletions

View File

@ -262,7 +262,7 @@ class HomeAssistant {
await _sendInitialMessage("get_panels").then((data) {
if (data["success"]) {
data["result"].forEach((k,v) {
String title = v['title'] == null ? "${k[0].toUpperCase()}${k.substring(1)}" : "${v['title'][0].toUpperCase()}${v['title'].substring(1)}";
String title = v['title'] == null ? "${k[0]?.toUpperCase()}${k?.substring(1)}" : "${v['title'][0]?.toUpperCase()}${v['title']?.substring(1)}";
panels.add(Panel(
id: k,
type: v["component_name"],

View File

@ -85,7 +85,7 @@ class HAView {
} else {
return
Tab(
text: name.toUpperCase(),
text: "${name?.toUpperCase()}",
);
}
} else {
@ -99,7 +99,7 @@ class HAView {
);
} else {
return Tab(
text: linkedEntity.displayName.toUpperCase(),
text: "${linkedEntity?.displayName?.toUpperCase()}",
);
}

View File

@ -243,7 +243,7 @@ class CardWidget extends StatelessWidget {
Widget _buildEntityButtonCard(BuildContext context) {
card.linkedEntityWrapper.displayName = card.name?.toUpperCase() ??
card.linkedEntityWrapper.displayName.toUpperCase();
card.linkedEntityWrapper.displayName?.toUpperCase();
return Card(
child: EntityModel(
entityWrapper: card.linkedEntityWrapper,