相关疑难解决方法(0)

如何在Flutter中禁用FlatButton的启动突出显示?

我有一个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
              ),
          )
        ],
      ),
    ),
  ),
);
Run Code Online (Sandbox Code Playgroud)

user-interface android ios dart flutter

15
推荐指数
3
解决办法
4033
查看次数

在Row Flutter中设置Elements之间的空间

码:

new Container(
          alignment: FractionalOffset.center,
          child: new Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              new FlatButton(
                child: new Text('Don\'t have an account?', style: new TextStyle(color: Color(0xFF2E3233))),
              ),
              new FlatButton(
                child: new Text('Register.', style: new TextStyle(color: Color(0xFF84A2AF), fontWeight: FontWeight.bold),),
                onPressed: moveToRegister,
              )
            ],
          ),
        ),  
Run Code Online (Sandbox Code Playgroud)

这是结果:https:
//www.dropbox.com/s/sxklyutyvbbura8/Screenshot_20181104-150928.png?dl = 0

如何确定两个FlatButton元素并排,屏幕宽度中心之间没有空间?

row dart flutter

14
推荐指数
7
解决办法
3万
查看次数

从 Flutter PopupMenuButton 中删除内边距

有什么想法如何从 Flutter PopupmenuButton 中删除巨大的填充吗?像ShrinkWrap 或者甚至可以使用的替代小部件之类的东西?它破坏了我的元素的对齐。

我尝试将其设置padding为 0 但完全没有效果。

padding: EdgeInsets.all(0)
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

在此输入图像描述

popupmenubutton flutter

10
推荐指数
1
解决办法
1万
查看次数

减少 flutter 中应用栏按钮的填充

如何减少按钮之间的间距?

您可以看到应用程序栏上的四个按钮占用了很多空间,我尝试过行。但没有工作

在此输入图像描述 下面是我的代码——

 AppBar(
  backgroundColor: Colors.deepOrange,
  iconTheme: new IconThemeData(color: Colors.white),
  title: Text(
    titleString,
    style: TextStyle(color: Colors.white),
  ),

  actions: <Widget>[

    IconButton(

      icon: Icon(
        Icons.search,
        color: Colors.white,
      ),
      //iconSize: 20,
      onPressed: null,
    ),
    IconButton(
      icon: Icon(
        Icons.notifications_none,
        color: Colors.white,
      ),
     // iconSize: 20,

      onPressed: null,
    ),
    //Add more icon here

  ],
);
Run Code Online (Sandbox Code Playgroud)

appbar dart flutter

2
推荐指数
1
解决办法
8911
查看次数

标签 统计

flutter ×4

dart ×3

android ×1

appbar ×1

ios ×1

popupmenubutton ×1

row ×1

user-interface ×1