【问题标题】:Specify optional keyword argument in constructor flutter在构造函数颤振中指定可选的关键字参数
【发布时间】:2023-02-14 17:43:02
【问题描述】:
  final Widget child;
  final Colors color;

  const FlexibleContainer({required this.child, Colors? this.color, Key? key}) : super(key: key);

我在 this.color 中收到错误 - parameter type Colors is incompatible with field type Colors

【问题讨论】:

    标签: flutter dart


    【解决方案1】:

    “颜色”是一类吗?如果不是,则将其更改为“最终颜色颜色”

    【讨论】:

      猜你喜欢
      • 2021-08-29
      • 2017-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-26
      • 2019-04-05
      • 2019-02-26
      • 2021-08-14
      相关资源
      最近更新 更多