Switched from SnackBar to Toast messages
All checks were successful
Build Flutter Web and Docker Image for Local Registry / Build Flutter Web App (push) Successful in 3m11s

This commit is contained in:
whysman 2024-11-10 18:17:09 -05:00
parent f20a257102
commit 280b963641
2 changed files with 8 additions and 4 deletions

View File

@ -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<StatusPage> {
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,
);
}
}

View File

@ -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.