【问题标题】:how to change the location of my flatbutton in flutter... (from most left to most right)如何在颤动中更改我的平面按钮的位置......(从最左边到最右边)
【发布时间】:2019-04-15 19:18:23
【问题描述】:

我已经构建了一个简单的应用程序来学习颤振。我想将一个平面按钮移动到屏幕的最右侧。

我似乎无法使用填充属性,我不知道为什么。

new FlatButton(
  onPressed: () => debugPrint("pressed"),
  child: new Text("DONATE",
    style: new TextStyle(
      fontSize: 16,
      color: Colors.green[400]
    )
  )
)

【问题讨论】:

    标签: flutter padding flutter-layout


    【解决方案1】:

    试试这个:

    Row(
      mainAxisAlignment: MainAxisAlignment.end,
      children: <Widget>[
        FlatButton(
          onPressed: () => debugPrint("pressed"),
          child: new Text("DONATE",
            style: new TextStyle(
              fontSize: 16,
              color: Colors.green[400]
            )
          )
        ),
      ],
    ),
    

    【讨论】:

      【解决方案2】:

      你检查过颤振布局吗,here

      plus padding 属性是用于在按钮内部移动按钮操作的margin 属性。 希望对您有所帮助。

      【讨论】:

      • 将您的按钮包装在一个容器中
      猜你喜欢
      • 2012-05-21
      • 1970-01-01
      • 2012-02-23
      • 1970-01-01
      • 2016-02-05
      • 2020-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多