bot_toast icon indicating copy to clipboard operation
bot_toast copied to clipboard

Multiple toasts overlap

Open muezz opened this issue 1 year ago • 1 comments

Describe the bug When multiple toasts are triggered, they animate over each other.

To Reproduce Steps to reproduce the behavior:

  1. Trigger a showCustomNotification. Use the code below:
void botToast() {
    BotToast.showCustomNotification(
      align: Alignment.bottomCenter,
      enableSlideOff: true,
      onlyOne: false,
      crossPage: true,
      animationDuration: _toastDuration,
      animationReverseDuration: _toastDuration,
      backButtonBehavior: BackButtonBehavior.ignore,
      dismissDirections: [DismissDirection.down, DismissDirection.horizontal],
      duration: _autoCloseDuration,
      toastBuilder: (cancelFunc) {
        return _CoreToastV2.generic(
          cancel: cancelFunc,
          message:
              'Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old',
        );
      },
      wrapToastAnimation: (controller, cancelFunc, widget) {
        return SizeTransition(
          sizeFactor: controller,
          axis: Axis.horizontal,
          fixedCrossAxisSizeFactor: 1,
          child: widget,
        );
      },
    );
  }
  1. Trigger it multiple times.

Expected behavior I would prefer to have a the ability to customize this behavior.

Screenshots https://github.com/user-attachments/assets/a1d54b32-fcc1-4407-811c-1b9857ebaa89

Version (please complete the following information):

  • Flutter Version: v3.24.0
  • OS: iOS 17.5
  • BotToast Version : 4.1.3

muezz avatar Aug 26 '24 08:08 muezz

This cannot be avoided if onlyOne is set to false.

MMMzq avatar Sep 06 '24 09:09 MMMzq

@MMMzq I understand. I think it would be great to allow the developer to customize how multiple toasts animate. Like should they overlap or should they animate animate on the top like they are in a column, etc.

muezz avatar Sep 06 '24 10:09 muezz