相关疑难解决方法(0)

Flutter TextButton splashColor 属性

我正在使用FlatButton并通过属性

FlatButton(
      splashColor: Colors.transparent,
      highlightColor: Colors.transparent,
      child: ..., 
)
Run Code Online (Sandbox Code Playgroud)

文件说FlatButton将变得过时,并使用TextButton替代,但它并不需要splashColorhighlightColor性质

TextButton(                  
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
    child: ...,       
)
Run Code Online (Sandbox Code Playgroud)

不起作用。不允许

我也试过这样

TextButton(            
  style: ButtonStyle(
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
  ),
  child: ..., 
)
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?谢谢

flutter flutter-layout flutter-web

17
推荐指数
5
解决办法
5126
查看次数

标签 统计

flutter ×1

flutter-layout ×1

flutter-web ×1