Files
2026-06-18 15:02:28 +08:00

27 lines
710 B
Dart

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
// void showAppToast(BuildContext context, String message) {
// ScaffoldMessenger.of(context)
// ..hideCurrentSnackBar()
// ..showSnackBar(
// SnackBar(content: Text(message), duration: const Duration(seconds: 2)),
// );
// }
Future<bool?> toastInfo({
required String msg,
Color backgroundColor = const Color(0xCC111111),
Color textColor = Colors.white,
}) {
return Fluttertoast.showToast(
msg: msg,
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM,
timeInSecForIosWeb: 1,
backgroundColor: backgroundColor,
textColor: textColor,
fontSize: 16,
);
}