diff --git a/lib/session.dart b/lib/session.dart index c7b5057..ee0361c 100644 --- a/lib/session.dart +++ b/lib/session.dart @@ -113,7 +113,7 @@ class SessionRouteState extends State with SingleTickerProviderSta // App went into background - FGBGType.background dlog("App went into background"); inBackground = true; - if (session!.isActive()) { + if (session != null && session!.isActive()) { await session!.stop(); } else { if (HotwordDetector().isActive()) { @@ -338,7 +338,9 @@ class SessionRouteState extends State with SingleTickerProviderSta // } // Update text field with response - String t = "${resp["q"].sentenceCapitalized()}\n\n${resp["answer"].sentenceCapitalized()}"; + final String q = "${resp['q']}".sentenceCapitalized(); + final String a = "${resp['answer']}".sentenceCapitalized(); + String t = "$q\n\n$a"; if (resp['source'] != null && resp['source'] != '') { t += " (${resp['source']})"; } diff --git a/pubspec.yaml b/pubspec.yaml index f9c43f5..c51db98 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: embla description: Cross-platform mobile Icelandic-language voice assistant. publish_to: 'none' -version: 1.4.0+591 +version: 1.4.0+592 homepage: https://embla.is repository: https://github.com/mideind/EmblaFlutterApp