小编Kuc*_*Nad的帖子

Flutter-向 OutlinedButton 小部件添加填充

我在为 OutlinedButton 添加 pad 时遇到问题,我一直在使用 OutlinedButton,并且我决定使用 OutlinedButton,因为该按钮已折旧。但是,在未定义 padding 参数的情况下,按钮的用法有所不同。我尝试将 OutlinedButton 包装在 ButtonTheme 中,但没有任何效果,现在我正在使用 Padding,如下面的代码示例所示。

new Column(children: [
              new Row(children: [
                //5th row
                new Expanded(
                  child: Padding(
                      child: new OutlinedButton(
                    child: new Text(
                      "Main Page",
                      style: TextStyle(
                          fontFamily: 'NotoSans',
                          fontSize: 20.0,
                          fontWeight: FontWeight.w400),
                    ),
                    onPressed: () {
                      Navigator.of(context).push(_gotoMainPage());
                    },
                    padding: EdgeInsets.all(20),
                  )),
                )
              ]),
            ])
          ],
        ),
Run Code Online (Sandbox Code Playgroud)

提前致谢。

button flutter

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

标签 统计

button ×1

flutter ×1