Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircularMenuItem not trigger onTab #13

Closed
mahmood-heja opened this issue Nov 30, 2020 · 1 comment
Closed

CircularMenuItem not trigger onTab #13

mahmood-heja opened this issue Nov 30, 2020 · 1 comment

Comments

@mahmood-heja
Copy link

when try to a test the onTap for CircularMenuItem not called

CircularMenu(
                toggleButtonIconColor: ColorsHelper.BUTTON_COLOR,
                backgroundWidget: Container(
                  height: 60,
                  width: 60,
                ),
                toggleButtonSize: 16,
                animationDuration: Duration(milliseconds: 500),
                startingAngleInRadian: pi,
                endingAngleInRadian: 1.5 * pi,
                radius: 70,
                curve: Curves.bounceOut,
                reverseCurve: Curves.fastOutSlowIn,
                alignment: Alignment.center,
                toggleButtonBoxShadow: [
                  BoxShadow(
                    color: ColorsHelper.BUTTON_COLOR,
                    blurRadius: 10,
                  ),
                ],
                toggleButtonColor: Colors.white,
                items: [
                  CircularMenuItem(
                    color: Colors.white,
                    iconColor: ColorsHelper.MENU_ICON_COLOR,
                    iconSize: 24,
                    icon: Icons.download_sharp,
                    onTap: () => downloadApk(app),
                  ),
                  CircularMenuItem(
                    iconSize: 24,
                    color: Colors.white,
                    iconColor: ColorsHelper.MENU_ICON_COLOR,
                    icon: Icons.share,
                    onTap: () {
                      print("Share");
                      //callback
                    },
                  ),
                  CircularMenuItem(
                    iconSize: 24,
                    color: Colors.white,
                    iconColor: ColorsHelper.MENU_ICON_COLOR,
                    icon: Icons.edit,
                    onTap: () => openAppDetail(app),
                  ),
                ],
              )
@hasan-hm1
Copy link
Owner

Hi @mahmood-heja
Thanks for opening this issue and sorry for the late response,
Problem
Please notice that CircularMenu uses Stack and Transform widget under the hood , When you tap on part of widget outside the original boundary lines, the parent widget thinks you are not hitting it (in your case the 60 * 60 container) since, you technically tapped outside the widget , this limitation is related to Transform widget please refer this , this and this .
Solution
Please make sure the backgroundWidget is big enough to transform the tappable area so tap is detected and onTap is triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants