【问题标题】:Inkwell showing two ripple effect显示两个涟漪效应的墨水瓶
【发布时间】:2020-08-11 02:35:54
【问题描述】:
 PopupMenuItem(
            value: 1,
            height: 90.w,
            child: InkWell(
              onTap: () {
                setState(() {
                  status = "Online";
                });
                Navigator.pop(context);
              },
              child: Container(
                margin: EdgeInsets.only(top: 3, bottom: 3, left: 3, right: 3),
                child: Row(
                  children: <Widget>[
                    Image.asset("images/online_list.png",
                        width: 25.w, height: 25.w),
                    Padding(
                      padding: EdgeInsets.only(left: 20.w),
                      child: CustomText('Online', MyApp.subDetailTextSize,
                          FontWeight.w500, MyApp.blackText, 'Lato'),
                    ),
                  ],
                ),
              ),
            ),
          ),

所以这是我的代码,当我单击该项目时,它也会在行内外显示波纹效果,即同时出现 2 个波纹效果。我想删除行周围的内部。

我尝试删除容器及其边距,但它也没有那样工作。

【问题讨论】:

    标签: flutter flutter-layout


    【解决方案1】:

    您可以在InkWell 中添加highlightColorsplashColor 属性,例如:

    PopUpMenuItem(
        child: InkWell(
           highlightColor: Colors.transparent,
           splashColor: Colors.transparent,
           onTap: (){
               // Do your stuffs
           },
           child: // Your child widget
        ),
    ),
    

    你可以看到InkWellhere的所有属性。

    【讨论】:

      猜你喜欢
      • 2018-01-07
      • 2016-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多