【问题标题】:How to solve this widget problem on flutter?如何在颤振上解决这个小部件问题?
【发布时间】:2021-03-14 23:13:51
【问题描述】:

在'body'中,不能有两个'child'?只允许一个? 如果是,如何添加图片中的几个小部件?例如)ElevatedButton(),列(儿童:? 并且在“Column(children:”下面有一个红色下划线。 谁能告诉我为什么会这样?

【问题讨论】:

  • 您只能拥有一个child。但是你可以有多个children。

标签: android flutter


【解决方案1】:

您需要执行以下操作

body: Center(
  child: Column(
     children: [
       ElevatedButton(child: ...)
       Container(child: ....)
       ...
       ]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-12
    • 2021-07-02
    • 2019-12-23
    • 1970-01-01
    • 2021-08-11
    • 2021-01-19
    • 2022-01-25
    • 2021-06-12
    相关资源
    最近更新 更多