koukibadr / Elegant-Notification

https://pub.dev/packages/elegant_notification
MIT License
47 stars 33 forks source link

Can not show when using Get.context with Getx package #96

Open abdulrehman192 opened 1 year ago

abdulrehman192 commented 1 year ago

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.

reminders[bot] commented 1 year ago

@koukibadr set a reminder for Oct 23rd 2023

mminhlequang commented 9 months ago

same with appNavigatorKey.currentContext

koukibadr commented 9 months ago

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

adar2378 commented 8 months ago

Same here, can not use with global ScaffoldMessagerKey

Pranavmaid commented 4 months ago

any update on this?

PRAVEJOE commented 3 months ago
  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

TOMSLAUS commented 1 month ago

Did anyone find viable work around?