【问题标题】:What is the difference between child: and children: property in Flutter?Flutter 中的 child: 和 children: 属性有什么区别?
【发布时间】:2019-05-31 21:49:04
【问题描述】:

Flutter 中的 child: 和 children: 属性有什么区别?

我从 Flutter 官方文档开始学习 Flutter 2 周,感觉不像学习 Android 那样容易。

【问题讨论】:

    标签: flutter flutter-layout


    【解决方案1】:

    child 采用单个小部件

    child: Text('foo')
    

    children 获取小部件列表

    children: <Widget>[Text('foo'), Text('bar')]
    

    【讨论】:

    • 谢谢。君特·佐赫鲍尔。这确实是一个简短的答案。你能告诉我一些 Flutter 优秀教程的链接吗?
    • 不确定您认为什么是好的教程。一个好的起点是flutter.io github.com/Solido/awesome-flutter 可能也会有所帮助。
    • 清晰简洁。谢谢。
    • @ThitSarNL 我最近开始学习 Flutter,我认为学习 Flutter 的一个非常实用的资源是“Flutter Apprentice By Vincenzo Guzzi、Kevin D Moore、Vincent Ngo 和 Michael Katz”一书。 Link for book
    猜你喜欢
    • 2019-11-09
    • 1970-01-01
    • 2011-12-17
    • 2016-04-29
    • 2011-11-14
    相关资源
    最近更新 更多