记录flutter---去除按钮的水波纹

496 阅读1分钟

去除完水波纹之后,hover状态都没有了,纯纯的一个按钮,点击、触摸等状态都没有了。上代码 。

           style: ButtonStyle(
               overlayColor:MaterialStateProperty.resolveWith((states) {
                                   return Colors.transparent;
                             })),
                   child: Text(
                        item.toString(),
                         style: const TextStyle(
                            color: Colors.black),
                          ),
                   onPressed: () {
                       controller.currentTab = item;
                         },
               ),

overlayColor:MaterialStateProperty.resolveWith((states) { return Colors.transparent; })), 这个是主要代码。。会用就行