我有一个FlatButton。单击按钮时,我不希望启动突出显示。我尝试将初始颜色更改为透明,但这没有用。这是我的FlatButton的代码。
Widget button = new Container( child: new Container( padding: new EdgeInsets.only(bottom: 20.0), alignment: Alignment.center, child: new FlatButton( onPressed: () { _onClickSignInButton(); }, splashColor: Colors.transparent, child: new Stack( alignment: Alignment.center, children: <Widget>[ new Image.asset('images/1.0x/button1.png', ), new Text("SIGN IN", style: new TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 16.0 ), ) ], ), ), ), );
我希望使用一种不可见的高光颜色来做您想要的事情:
new FlatButton({ ... splashColor: Colors.transparent, highlightColor: Colors.transparent, // makes highlight invisible too })