cmdrootaccess / another-flushbar

A flexible widget for user notification. Customize your text, button, duration, animations and much more. For Android devs, it is made to replace Snackbars and Toasts.
https://pub.dev/packages/another_flushbar
MIT License
145 stars 88 forks source link

Tapping below a flushbar with FlushbarStyle.FLOATING triggers onTap #85

Closed Anderzzon closed 1 year ago

Anderzzon commented 1 year ago

We have a flushbar that is displayed above the bottom navigation bar. But if a user clicks on a tab in the bottom navigation bar, the flushbar's onTap is triggered

Flushbar(
        title:  "Jump in where you left off!",
        message:  "Current activity: ${courses.value?[1]?.currentActivityName?.des ?? ""}",
        backgroundColor: primaryColor,
        titleColor: Colors.white,
        messageColor: Colors.white,
        duration:  const Duration(seconds: 10),
        flushbarStyle: FlushbarStyle.FLOATING,
        icon: Container(
          margin: EdgeInsets.only(left: 12, right: 12),
            child: getIconFromActivityType("VideoItem", null, null)),
        margin: EdgeInsets.only(left: 8, right: 8, top: 8, bottom: 65),
        borderRadius: BorderRadius.circular(8),
        onTap: (_) => snackBarPressed(),
      ).show(Get.context!);
EArminjon commented 1 year ago

Maybe this PR fix that, can you check ? https://github.com/cmdrootaccess/another-flushbar/pull/86

Anderzzon commented 1 year ago

Thank you, this helps a bit. with this fix I'm still not able to click on the tabs in the bottom navigation bar, but the onTap is not triggered anymore.

Anderzzon commented 1 year ago

Actually I now solved the problem. Needed to use the parameter endOffset instead of margin.