Elegant-Notification icon indicating copy to clipboard operation
Elegant-Notification copied to clipboard

Can not show when using Get.context with Getx package

Open abdulrehman192 opened this issue 1 year ago • 6 comments

The notification only work if we pass the scaffold context. when I try to show it with Get.context and also try to make a App class with static navigator global key, it is not working.

abdulrehman192 avatar Aug 25 '23 08:08 abdulrehman192

@koukibadr set a reminder for Oct 23rd 2023

reminders[bot] avatar Oct 23 '23 07:10 reminders[bot]

same with appNavigatorKey.currentContext

mminhlequang avatar Jan 06 '24 09:01 mminhlequang

@mminhlequang @abdulrehman192 i'll verify this issue thanks for your feedback

koukibadr avatar Jan 07 '24 16:01 koukibadr

Same here, can not use with global ScaffoldMessagerKey

adar2378 avatar Feb 20 '24 13:02 adar2378

any update on this?

Pranavmaid avatar Jun 26 '24 17:06 Pranavmaid

  void show(BuildContext context) {
    overlayEntry = _overlayEntryBuilder();
    final overlay = Overlay.maybeOf(context);
    if (overlay != null) {
      overlay.insert(overlayEntry!);
    } else {
      Navigator.of(context).overlay?.insert(overlayEntry!);
    }
  } 

Try to Replace show() with above code in elegant_notification.dart page and try

PRAVEJOE avatar Jul 04 '24 06:07 PRAVEJOE