我有一个按钮.我不想在点击按钮时出现飞溅的高光.我试着把飞溅的 colored颜色 改成透明的,但没用.这是我的扁平按钮的代码.

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
              ),
          )
        ],
      ),
    ),
  ),
);

推荐答案

我希望一种看不见的高光 colored颜色 能满足你的需求:

new FlatButton({
  ...
  splashColor: Colors.transparent,  
  highlightColor: Colors.transparent, // makes highlight invisible too
})

Flutter相关问答推荐

Build.gradle专线:2个Flutter Flutter

为什么Build_Runner的输出为0?

如何在用Ffltter成功登录后重定向下一页?

升级到Ffltter 3.16后,应用程序栏、背景 colored颜色 、按钮大小和间距都会发生变化

怎么才能像这样在摆动着这些曲线呢?

任务';:app:check DebugDuplicateClasss';的Ffltter Share_plus抛出执行失败

使用持久的侧边菜单和顶部栏在Ffltter Web应用程序中的页面之间导航

将自定义容器附加到屏幕底部

Flutter:如何在 Future 函数上添加网络判断和 showDialog

更改下拉按钮的背景 colored颜色 - flutter

如何正确地将 PageView 设置为 AppBar 的标题?

Flutter blue plus 库,当try 从 esp32 驱动程序获取 PlatformException 时读取特性

减少 Flutter 中 API 的连接等待时间

具有 BLOC 和存储库模式的 Flutter Workmanager

如何在 cupertino switch flutter 中添加文本

Flutter/Dart 返回_Future的实例而不是实际的字符串值

Banner Ad.test 广告单元 ID 是否已过时?

如何在Flutter 中根据其父小部件高度设置图标按钮飞溅半径

我已经删除了我的 .android 密钥库,但我没有使用它,如何生成一个新的?

Flutter MQTT - 发布到主题 1 并收听主题 2