injectCssAndJS method
Implementation
Future<void> injectCssAndJS() async {
final List<Future<void>> loading = <Future<void>>[];
final List<html.HtmlElement> tags = <html.HtmlElement>[];
final html.LinkElement css = html.LinkElement()
..id = 'toast-css'
..attributes = {"rel": "stylesheet"}
..href = 'assets/packages/toast/assets/toastify.css';
tags.add(css);
final html.ScriptElement script = html.ScriptElement()
..async = true
// ..defer = true
..src = "assets/packages/toast/assets/toastify.js";
loading.add(script.onLoad.first);
tags.add(script);
html.querySelector('head')!.children.addAll(tags);
await Future.wait(loading);
}