From 280b963641b856aec2345be5849002fa3ceb0783 Mon Sep 17 00:00:00 2001 From: whysman Date: Sun, 10 Nov 2024 18:17:09 -0500 Subject: [PATCH] Switched from SnackBar to Toast messages --- lib/status_page.dart | 11 +++++++---- pubspec.yaml | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/status_page.dart b/lib/status_page.dart index e35ab25..7cc6939 100644 --- a/lib/status_page.dart +++ b/lib/status_page.dart @@ -4,6 +4,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:web_socket_channel/web_socket_channel.dart'; +import 'package:fluttertoast/fluttertoast.dart'; import 'shared_preferences_provider.dart'; @@ -60,10 +61,12 @@ class StatusPageState extends State { channel.sink.add(message); if (mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text( - 'Status "${newStatus.isEmpty ? 'cleared' : newStatus}" sent!')), + Fluttertoast.showToast( + msg: 'Status "${newStatus.isEmpty ? 'cleared' : newStatus}" sent!', + toastLength: Toast.LENGTH_SHORT, + gravity: ToastGravity.BOTTOM, + backgroundColor: Colors.black, + textColor: Colors.white, ); } } diff --git a/pubspec.yaml b/pubspec.yaml index 6b39afc..b54e417 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,6 +36,7 @@ dependencies: shared_preferences: ^2.0.9 image_picker: ^1.1.2 uuid: ^4.4.2 + fluttertoast: ^8.0.9 # The following adds the Cupertino Icons font to your application.