huextrat / menu_button

Flutter plugin to display a popup menu button widget with handsome design and easy to use.
https://pub.dev/packages/menu_button
MIT License
65 stars 23 forks source link

Issue with corner rounding #20

Closed jacksonw765 closed 3 years ago

jacksonw765 commented 3 years ago

Seems to be an issue with the rounding when a custom decorator is provided.

https://user-images.githubusercontent.com/13068724/111939667-42cd8680-8aa3-11eb-83a2-a70b1a3b2aad.mov

huextrat commented 3 years ago

Thank you for reporting the issue, indeed I think there is a problem there :/ Can you give a reproduction code please? It will help me a lot

jacksonw765 commented 3 years ago
          MenuButton<String>(
            menuButtonBackgroundColor: Colors.transparent,
            decoration: BoxDecoration(
              color: Styles.MAIN_COLOR_LIGHT, //border: Border.all(color: Colors.grey[300]!),
              borderRadius: const BorderRadius.all(
                Radius.circular(12.0),
              ),
            ),

            //showSelectedItemOnList: false,
            child: socialChildWidget(),
            itemBackgroundColor: Styles.MAIN_COLOR_LIGHT,
            items: this.optionValuesSocial,
            itemBuilder: (String value) => Container(
              color: Styles.MAIN_COLOR_LIGHT,
              height: 40,
              alignment: Alignment.centerLeft,
              padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 16),
              child: Text(
                value,
                style: TextStyle(color: Colors.white),
              ),
            ),
            toggledChild: socialChildWidget(),
            onItemSelected: (String value) async {
              socialValuesIndex = optionValuesSocial.indexOf(value);
              await requestProperSocial();
              setState(() {});
            },
            // this does nothing but when I remove it it crashes so it's staying lol
            onMenuButtonToggle: (bool isToggle) {},
          ),

    Widget socialChildWidget() {
        String localApiIndexValueString = optionValuesSocial[socialValuesIndex];
        return Container(
          width: 110,
          height: 40,
          child: Padding(
            padding: const EdgeInsets.only(left: 16, right: 11),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                Flexible(
                    child: Text(
                  localApiIndexValueString,
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(color: Colors.white),
                )),
                const SizedBox(
                  width: 12,
                  height: 17,
                  child: FittedBox(
                    fit: BoxFit.fill,
                    child: Icon(
                      Icons.arrow_drop_down,
                      color: Colors.white,
                    ),
                  ),
                ),
              ],
            ),
          ),
        );
      }
huextrat commented 3 years ago

@jacksonw765 Thanks for the example.

The issue has been fixed in version 1.4.2

jacksonw765 commented 3 years ago

Thank you very much! Love the package.