Commit c7216575 by Shadab Ansari Committed by GitHub

Used null aware operator "?" to avoid crash (#346)

Co-authored-by: Shadab <shadab.ansari@bsci.com>
parent 001e7604
......@@ -145,7 +145,7 @@ class FToast {
_entry = _toastEntry.entry;
if (context == null)
throw ("Error: Context is null, Please call init(context) before showing toast.");
Overlay.of(context!)!.insert(_entry!);
Overlay.of(context!)?.insert(_entry!);
_timer = Timer(_toastEntry.duration!, () {
Future.delayed(Duration(milliseconds: 360), () {
......
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