diff --git a/lib/Frontend/Widgets/back_button_to_close.dart b/lib/Frontend/Widgets/back_button_to_close.dart index 3e4be53a..9190fd12 100644 --- a/lib/Frontend/Widgets/back_button_to_close.dart +++ b/lib/Frontend/Widgets/back_button_to_close.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:awesome_snackbar_content/awesome_snackbar_content.dart'; import 'package:back_button_interceptor/back_button_interceptor.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -42,7 +43,17 @@ class _BackButtonToCloseState extends ConsumerState { timer = Timer(const Duration(seconds: 1), () {}); ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text(doubleBackToClose()), + /// need to set following properties for best effect of awesome_snackbar_content + elevation: 0, + behavior: SnackBarBehavior.floating, + backgroundColor: Colors.transparent, + content: AwesomeSnackbarContent( + title: doubleBackToCloseTitle(), + message: doubleBackToClose(), + + /// change contentType to ContentType.success, ContentType.warning or ContentType.help for variants + contentType: ContentType.help, + ), ), ); return true; diff --git a/lib/Frontend/translation_string_definitions.dart b/lib/Frontend/translation_string_definitions.dart index 3f5a1e6f..f9efe8c1 100644 --- a/lib/Frontend/translation_string_definitions.dart +++ b/lib/Frontend/translation_string_definitions.dart @@ -303,7 +303,9 @@ String onboardingDoneButtonLabel() => Intl.message("Done", name: 'onboardingDone String onboardingCompletedTitle() => Intl.message("Happy Wagging!", name: 'onboardingCompletedTitle', desc: 'Title of the final page of the onboarding screen'); -String doubleBackToClose() => Intl.message("Press again to exit ", name: 'doubleBackToClose', desc: 'Snackbar message which appears when the back button is pressed at the main screen'); +String doubleBackToClose() => Intl.message("Press again to exit", name: 'doubleBackToClose', desc: 'Snackbar message which appears when the back button is pressed at the main screen'); + +String doubleBackToCloseTitle() => Intl.message("Gear is still connected", name: 'doubleBackToCloseTitle', desc: 'Snackbar message which appears when the back button is pressed at the main screen'); String noLongerSupported() => Intl.message("This gear is no longer supported. Some app features may not work", name: 'noLongerSupported', desc: 'Warning message which appears for unsupported gear on the manage gear page'); diff --git a/pubspec.lock b/pubspec.lock index b0146da8..3e32f98d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -110,6 +110,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.3" + awesome_snackbar_content: + dependency: "direct main" + description: + name: awesome_snackbar_content + sha256: a94407ad596ac4b2f925b032c11f390cd3b3e640a9799f4983b86be0bc17f62b + url: "https://pub.dev" + source: hosted + version: "0.1.3" back_button_interceptor: dependency: "direct main" description: @@ -712,6 +720,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.2" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" + url: "https://pub.dev" + source: hosted + version: "2.0.10+1" flutter_test: dependency: "direct dev" description: flutter @@ -1839,6 +1855,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.4.0" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" vector_graphics_codec: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 26f94b80..daf91b92 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -83,7 +83,8 @@ dependencies: url: https://github.com/davigmacode/flutter_choice feedback: ^3.1.0 accessibility_tools: ^2.1.0 - + awesome_snackbar_content: ^0.1.3 + # Dio HTTP dio: ^5.4.3+1 native_dio_adapter: ^1.3.0