Commit 9403dab9 by Min (hood) Committed by GitHub

Fix crash with text include newline character(\n) on web (#271)

parent 7e65255f
...@@ -78,7 +78,7 @@ class FluttertoastWebPlugin { ...@@ -78,7 +78,7 @@ class FluttertoastWebPlugin {
int time = 3000, int time = 3000,
bool showClose = false, bool showClose = false,
int textColor}) { int textColor}) {
String m = msg.replaceAll("'", "\\'"); String m = msg.replaceAll("'", "\\'").replaceAll("\n", "<br />");
html.Element ele = html.querySelector("#toast-content"); html.Element ele = html.querySelector("#toast-content");
String content = """ String content = """
var toastElement = Toastify({ var toastElement = Toastify({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment