feat:参照研听的基础工程
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user