JackJonson / flutter_styled_toast

A Styled Toast Flutter package.
Apache License 2.0
76 stars 43 forks source link

Button inside widget in showToastWidget is unclickable #22

Closed RakaAlrian closed 3 years ago

RakaAlrian commented 3 years ago

I already set isIgnoring to false and put a button inside the widget I create in showToastWidget, the button is work until I set endOffset with Offset(0, 1), seems the button is ignoring the pointer. any suggestion?

RakaAlrian commented 3 years ago

this is how I implement the showToastWidget

showToastWidget(
      Container(
        width: MediaQuery.of(context).size.width - 40,
        padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 10),
        decoration: ShapeDecoration(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(12),
          ),
          color: Colors.green,
        ),
        child: Material(
          color: Colors.transparent,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Flexible(
                child: Icon(
                  Icons.info_outline_rounded,
                  color: Colors.white,
                ),
              ),
              const SizedBox(
                width: 10,
              ),
              Flexible(
                flex: 5,
                child: Text(
                  "styled toast experiment",
                  style: const TextStyle(
                    color: Colors.white,
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.symmetric(horizontal: 10),
                //DISMISS BUTTON
                child: InkResponse(
                  onTap: () {
                    dismissAllToast(showAnim: true);
                  },
                  radius: 15,
                  child: const Icon(
                    Icons.close,
                    color: Colors.white,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
      isIgnoring: false,
      dismissOtherToast: true,
      isHideKeyboard: true,
      endOffset: Offset(0, 1), //DISMISS BUTTON NOT WORKING AFTER I ADD THIS
      context: context,
      duration: Duration.zero,
      animation: StyledToastAnimation.slideFromTopFade,
      reverseAnimation: StyledToastAnimation.slideFromTopFade,
      position: StyledToastPosition.top,
    );
RakaAlrian commented 3 years ago

never mind, I can use margin in my container instead of using offset to arrange the position, I am sorry😅

RakaAlrian commented 3 years ago

btw, there is another issue with using margin and isIgnoring set to false, buttons or any widgets near the toast will become unclickable