koukibadr / Cherry-Toast

https://pub.dev/packages/cherry_toast
MIT License
21 stars 14 forks source link

autoDismiss #25

Open YouSour opened 2 years ago

YouSour commented 2 years ago

hi, s.th wrong when i use autoDismiss, when i close toast and suddenly i click to open it again, i got error like this, any idea ?

Error: This widget has been unmounted, so the State no longer has a context (and should be considered defunct).
Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active.
    at Object.throw_ [as throw] (http://localhost:61708/dart_sdk.js:5067:11)
at http://localhost:61708/packages/flutter/src/widgets/widget_inspector.dart.lib.js:12927:23
at cherry_toast._CherryToastState.new.get context [as context] (http://localhost:61708/packages/flutter/src/widgets/widget_inspector.dart.lib.js:12930:28)
at http://localhost:61708/packages/cherry_toast/cherry_toast.dart.lib.js:1536:55
    at internalCallback (http://localhost:61708/dart_sdk.js:26619:11)
koukibadr commented 2 years ago

Thanks @YouSour for your feedback, I will check the error the next version will bring the bug-fix to this

YouSour commented 2 years ago

@koukibadr noted , i wait for it 😄

koukibadr commented 2 years ago

Hello @YouSour I just published the bug fix in the new version 1.0.4 https://pub.dev/packages/cherry_toast

YouSour commented 2 years ago

@koukibadr that error solved , but i got this when i close toast by [X] close button then suddenly i click on barrier background :

Another exception was thrown: _CherryToastState#1fa87(tickers: tracking 1 ticker) was disposed with an active Ticker.
Error: Looking up a deactivated widget's ancestor is unsafe.
At this point the state of the widget's element tree is no longer stable.
To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling dependOnInheritedWidgetOfExactType() in the widget's didChangeDependencies() method.
    at Object.throw_ [as throw] (http://localhost:51136/dart_sdk.js:5067:11)
at http://localhost:51136/packages/flutter/src/widgets/widget_inspector.dart.lib.js:24344:21
at framework.StatefulElement.new.[_debugCheckStateIsActiveForAncestorLookup] (http://localhost:51136/packages/flutter/src/widgets/widget_inspector.dart.lib.js:24347:26)
at framework.StatefulElement.new.findAncestorStateOfType (http://localhost:51136/packages/flutter/src/widgets/widget_inspector.dart.lib.js:24388:61)
at Function.of (http://localhost:51136/packages/flutter/src/widgets/widget_inspector.dart.lib.js:20070:63)
at Function.pop (http://localhost:51136/packages/flutter/src/widgets/widget_inspector.dart.lib.js:20049:28)
at http://localhost:51136/packages/cherry_toast/cherry_toast.dart.lib.js:1258:33
    at internalCallback (http://localhost:51136/dart_sdk.js:26619:11)
koukibadr commented 2 years ago

@YouSour I didn't get the error when I test it, could you please send me the code snippet how you use the toast ?

koukibadr commented 1 year ago

Hello @YouSour check this new version with the bug fix https://pub.dev/packages/cherry_toast

YouSour commented 1 year ago

@koukibadr sorry, a bit late reply , i'm completely busy , thank you for info , i'll try it 😄

koukibadr commented 10 months ago

@YouSour if the error is fixed feel free to close this bug