FlutterToast
FlutterToast copied to clipboard
Unable to pop up in web build release
My application runs on the web and can be used normally when debugging in a local browser. However, after compiling and distributing the version using
flutter build web release web extender canvas tree share icons
it cannot be used.
This is my usage:
enum ToastPosition {
top,
bottom,
center,
topLeft,
topRight,
bottomLeft,
bottomFight,
centerLeft,
centerRight,
snackbar,
none,
}
static showToast(String text,
{ToastPosition position = ToastPosition.bottom}) async {
if (!kIsWeb) {
await Fluttertoast.cancel();
}
await Fluttertoast.showToast(
gravity: ToastGravity.values[position.index],
msg: text,
backgroundColor: const Color.fromARGB(128, 50, 50, 50),
textColor: Colors.white,
webBgColor: "rgb(128 128 128 / 0.5)",
webPosition: "center",
webShowClose: false,
timeInSecForIosWeb: 1,
);
}