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
Global navigator key context is not working toastification.show( context: globalNavigatorKey.currentContext!, title: const Text('Hello, world!'), autoCloseDuration: const Duration(seconds: 5), );
To Reproduce
Steps to reproduce the behavior:
Add a global navigator key in the main.dart file
Pass the navigator key to MaterialApp
Call the toast using this globalKey context
Check the console log
`
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:toastification/src/core/toastification_overlay_state.dart': Failed assertion: line 18 pos 5: '_debugInitialized': Toastification is not initialized!
E/flutter ( 3507): ensure your app is wrapped with a ToastificationWrapper widget
E/flutter ( 3507): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
E/flutter ( 3507): Custom Animation #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
E/flutter ( 3507): add custom animation posibility #2 findToastificationOverlayState (package:toastification/src/core/toastification_overlay_state.dart:18:5)
E/flutter ( 3507): v0.3.0 released #3 Toastification.showCustom (package:toastification/src/core/toastification.dart:136:36)
E/flutter ( 3507): Improvements #4 Toastification.show (package:toastification/src/core/toastification.dart:264:12)
E/flutter ( 3507): how can enable showProgressBar flag when i use toastification.showCustom() method #5 _TestScreenState.build. (package:wsac/presentation/test_screen.dart:61:32)
E/flutter ( 3507): Welcome to toastification Discussions! #6 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1154:21)
E/flutter ( 3507): Addition of dismiss all toasts at once. #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275:24)
E/flutter ( 3507): add new structure for built in toasts #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:654:11)
E/flutter ( 3507): add dismissAll function #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:311:5)
E/flutter ( 3507): add toastification manager and alignment to toasts #10 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:244:7)
E/flutter ( 3507): add document for core classes #11 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:630:9)
E/flutter ( 3507): add swipe to dismiss feature #12 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
E/flutter ( 3507): خطا در موقع بسته شدن دیالوگ #13 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:143:9)
E/flutter ( 3507): update and deploy example app #14 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
E/flutter ( 3507): fix some detected issues . #15 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
E/flutter ( 3507): update shadow structure & animation builder #16 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7)
E/flutter ( 3507): update default icons and primary colors #17 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:488:19)
E/flutter ( 3507): add support for textDirection #18 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:468:22)
E/flutter ( 3507): add progress bar #19 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:333:11)
E/flutter ( 3507): add different close types #20 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:413:7)
E/flutter ( 3507): add custom animation to example #21 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:376:5)
E/flutter ( 3507): fix example design issues in v1.0.0 #22 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:323:7)
E/flutter ( 3507): Refactor built in widget and remove opacity force change #23 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:292:9)
E/flutter ( 3507): Add early return and delete .toList when we don't need it! #24 _invoke1 (dart:ui/hooks.dart:186:13)
E/flutter ( 3507): Add equatable and change cupertino with widgets #25 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:424:7)
E/flutter ( 3507): Add _disposeAnimation() #26 _dispatchPointerDataPacket (dart:ui/hooks.dart:119:31)
E/flutter ( 3507):
`
Expected behavior
Should display a toast without any error
Flutter information:
OS: android and iOS
Flutter Version: 3.24.0
Toastification Version 2.0.0
NB: All the widgets are working fine with global navigator key
The text was updated successfully, but these errors were encountered:
Global navigator key context is not working
toastification.show( context: globalNavigatorKey.currentContext!, title: const Text('Hello, world!'), autoCloseDuration: const Duration(seconds: 5), );
To Reproduce
Steps to reproduce the behavior:
`
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:toastification/src/core/toastification_overlay_state.dart': Failed assertion: line 18 pos 5: '_debugInitialized': Toastification is not initialized!
E/flutter ( 3507): ensure your app is wrapped with a ToastificationWrapper widget
E/flutter ( 3507): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
E/flutter ( 3507): Custom Animation #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
E/flutter ( 3507): add custom animation posibility #2 findToastificationOverlayState (package:toastification/src/core/toastification_overlay_state.dart:18:5)
E/flutter ( 3507): v0.3.0 released #3 Toastification.showCustom (package:toastification/src/core/toastification.dart:136:36)
E/flutter ( 3507): Improvements #4 Toastification.show (package:toastification/src/core/toastification.dart:264:12)
E/flutter ( 3507): how can enable showProgressBar flag when i use toastification.showCustom() method #5 _TestScreenState.build. (package:wsac/presentation/test_screen.dart:61:32)
E/flutter ( 3507): Welcome to toastification Discussions! #6 _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1154:21)
E/flutter ( 3507): Addition of dismiss all toasts at once. #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275:24)
E/flutter ( 3507): add new structure for built in toasts #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:654:11)
E/flutter ( 3507): add dismissAll function #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:311:5)
E/flutter ( 3507): add toastification manager and alignment to toasts #10 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:244:7)
E/flutter ( 3507): add document for core classes #11 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:630:9)
E/flutter ( 3507): add swipe to dismiss feature #12 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
E/flutter ( 3507): خطا در موقع بسته شدن دیالوگ #13 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:143:9)
E/flutter ( 3507): update and deploy example app #14 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
E/flutter ( 3507): fix some detected issues . #15 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
E/flutter ( 3507): update shadow structure & animation builder #16 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7)
E/flutter ( 3507): update default icons and primary colors #17 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:488:19)
E/flutter ( 3507): add support for textDirection #18 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:468:22)
E/flutter ( 3507): add progress bar #19 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:333:11)
E/flutter ( 3507): add different close types #20 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:413:7)
E/flutter ( 3507): add custom animation to example #21 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:376:5)
E/flutter ( 3507): fix example design issues in v1.0.0 #22 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:323:7)
E/flutter ( 3507): Refactor built in widget and remove opacity force change #23 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:292:9)
E/flutter ( 3507): Add early return and delete .toList when we don't need it! #24 _invoke1 (dart:ui/hooks.dart:186:13)
E/flutter ( 3507): Add equatable and change cupertino with widgets #25 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:424:7)
E/flutter ( 3507): Add _disposeAnimation() #26 _dispatchPointerDataPacket (dart:ui/hooks.dart:119:31)
E/flutter ( 3507):
`
Expected behavior
Should display a toast without any error
Flutter information:
NB: All the widgets are working fine with global navigator key
The text was updated successfully, but these errors were encountered: