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:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:web_socket_channel/web_socket_channel.dart'; import 'package:web_socket_channel/web_socket_channel.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'shared_preferences_provider.dart'; import 'shared_preferences_provider.dart';
@ -60,10 +61,12 @@ class StatusPageState extends State<StatusPage> {
channel.sink.add(message); channel.sink.add(message);
if (mounted) { if (mounted) {
ScaffoldMessenger.of(context).showSnackBar( Fluttertoast.showToast(
SnackBar( msg: 'Status "${newStatus.isEmpty ? 'cleared' : newStatus}" sent!',
content: Text( toastLength: Toast.LENGTH_SHORT,
'Status "${newStatus.isEmpty ? 'cleared' : newStatus}" sent!')), gravity: ToastGravity.BOTTOM,
backgroundColor: Colors.black,
textColor: Colors.white,
); );
} }
} }

View File

@ -36,6 +36,7 @@ dependencies:
shared_preferences: ^2.0.9 shared_preferences: ^2.0.9
image_picker: ^1.1.2 image_picker: ^1.1.2
uuid: ^4.4.2 uuid: ^4.4.2
fluttertoast: ^8.0.9
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.