You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've been using this library in multiple ways without knowing (I wasn't a part in setup of the project), here's what I mean:
Wrapped the whole app in StyledToast widget (StyledToast(child: MaterialApp(..)))
Calling showToast using context parameter (showToast and showToastWidget)
We had an issue where the provided context could be disposed while the toast was showing (and/or was trying to dismiss), causing the following error:
Null check operator used on a null value
#0 OverlayEntry.remove (package:flutter/src/widgets/overlay.dart:170)
#1 ToastFuture.dismiss (package:flutter_styled_toast/src/styled_toast_manage.dart:74)
#2 new ToastFuture.create.<anonymous closure> (package:flutter_styled_toast/src/styled_toast_manage.dart:51)
#3 Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18)
#4 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398)
#5 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429)
#6 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184)
/// in a widget under the same widget tree/// `context` is from the widgetshowToast(..., context: context, ...);
// orshowToastWidget(Text(...), context: context, ..);
At least that's the reason we think it's happening, since it stops happening when we set context parameter to null or don't use context parameter at all.
Why be able to do both?
One way this could be avoided would be to have showToast that doesn't have context parameter, and another called showToastOn with a context parameter.
Let me know if I can help.
The text was updated successfully, but these errors were encountered:
@jonasborggren It is/was, and the simple modification I posted there has eliminated any further reports in Crashlytics - I could never reproduce the error locally. This package appears abandoned, so I just use locally hosted / modified source in my app now.
We've been using this library in multiple ways without knowing (I wasn't a part in setup of the project), here's what I mean:
StyledToast
widget (StyledToast(child: MaterialApp(..))
)showToast
usingcontext
parameter (showToast
andshowToastWidget
)We had an issue where the provided
context
could be disposed while the toast was showing (and/or was trying to dismiss), causing the following error:At least that's the reason we think it's happening, since it stops happening when we set
context
parameter tonull
or don't usecontext
parameter at all.Why be able to do both?
One way this could be avoided would be to have
showToast
that doesn't have context parameter, and another calledshowToastOn
with a context parameter.Let me know if I can help.
The text was updated successfully, but these errors were encountered: