From 14cc55a2c7dd01dd5a45395cf130c6da75721449 Mon Sep 17 00:00:00 2001 From: estevez-dev Date: Thu, 9 May 2019 13:16:35 +0300 Subject: [PATCH] Resolves #373 --- lib/home_assistant.class.dart | 2 +- lib/ui_class/view.class.dart | 4 ++-- lib/ui_widgets/card_widget.dart | 2 +- pubspec.lock | 24 ++++++++++++------------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/home_assistant.class.dart b/lib/home_assistant.class.dart index 8369428..430f9d4 100644 --- a/lib/home_assistant.class.dart +++ b/lib/home_assistant.class.dart @@ -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"], diff --git a/lib/ui_class/view.class.dart b/lib/ui_class/view.class.dart index 5adb2e1..276b290 100644 --- a/lib/ui_class/view.class.dart +++ b/lib/ui_class/view.class.dart @@ -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()}", ); } diff --git a/lib/ui_widgets/card_widget.dart b/lib/ui_widgets/card_widget.dart index 68dfd88..32eae60 100644 --- a/lib/ui_widgets/card_widget.dart +++ b/lib/ui_widgets/card_widget.dart @@ -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, diff --git a/pubspec.lock b/pubspec.lock index b25c2fe..ec53ce2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: cached_network_image url: "https://pub.dartlang.org" source: hosted - version: "0.7.0" + version: "0.8.0" charcode: dependency: transitive description: @@ -100,7 +100,7 @@ packages: name: event_bus url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -152,7 +152,7 @@ packages: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.0+1" + version: "0.12.0+2" http_parser: dependency: transitive description: @@ -166,14 +166,14 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.8" intl: dependency: transitive description: name: intl url: "https://pub.dartlang.org" source: hosted - version: "0.15.7" + version: "0.15.8" logging: dependency: transitive description: @@ -187,7 +187,7 @@ packages: name: markdown url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" matcher: dependency: transitive description: @@ -215,14 +215,14 @@ packages: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.4.0" + version: "0.4.1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" path_provider: dependency: transitive description: @@ -264,7 +264,7 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.1+1" + version: "0.5.2" sky_engine: dependency: transitive description: flutter @@ -283,7 +283,7 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "1.1.5" stack_trace: dependency: transitive description: @@ -346,7 +346,7 @@ packages: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" vector_math: dependency: transitive description: @@ -360,7 +360,7 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "1.0.12" xml: dependency: transitive description: