【问题标题】:How to use a List in a Row FLutter如何在行中使用列表 FLutter
【发布时间】:2021-12-11 08:25:42
【问题描述】:

我尝试使用已经创建的列表,但我一直收到此错误lib/main.dart:94:21: Error: The argument type 'List<dynamic>' can't be assigned to the parameter type 'List<Widget>'.

- 'List' is from 'dart:core'.

- 'Widget' is from 'package:flutter/src/widgets/framework.dart'

('/C:/fluttersdk/flutter/packages/flutter/lib/src/widgets/framework.dart').

children: scoreKeeper,

Using the list with my Row

Creating List

【问题讨论】:

    标签: android flutter dart mobile


    【解决方案1】:

    在 main.dart 中将列表定义为 List scoreKeeper。

    【讨论】:

      【解决方案2】:

      scoreKeeper 变量设为List<Widget> 类型,而不仅仅是List

      【讨论】:

      • 非常感谢它的工作
      猜你喜欢
      • 2020-09-23
      • 2019-12-28
      • 2021-09-09
      • 1970-01-01
      • 2020-03-27
      • 1970-01-01
      • 2023-01-10
      • 2022-01-10
      • 2020-07-29
      相关资源
      最近更新 更多