【问题标题】:Getting error DiagnosticableMixin after Update flutter SDK 2.0更新颤振 SDK 2.0 后出现错误 DiagnosticableMixin
【发布时间】:2021-06-11 03:34:06
【问题描述】:

更新 Flutter SDK 2.0 后,我遇到了以下错误。

../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cupertino_date_picker-1.0.26+2/lib/src/date_picker_theme.dart:23:32:错误:类型'未找到 DiagnosticableMixin。 类 DateTimePickerTheme 与 DiagnosticableMixin { ^^^^^^^^^^^^^^^^^^^ ../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cupertino_date_picker-1.0.26+2/lib/src/date_picker_theme.dart:23:7:错误:类型“DiagnosticableMixin”不能混进去。 类 DateTimePickerTheme 与 DiagnosticableMixin { ^ ../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cupertino_date_picker-1.0.26+2/lib/src/date_picker.dart:103:34:错误:没有命名参数命名为“shadowThemeOnly”。 主题:Theme.of(context, shadowThemeOnly: true), ^^^^^^^^^^^^^^^ ../../SDK/flutter/packages/flutter/lib/src/material/theme.dart:107:20:上下文:找到了这个候选人,但参数不匹配。 static ThemeData of(BuildContext context) {

【问题讨论】:

    标签: android flutter sdk


    【解决方案1】:

    检查 flutter_cupertino_date_picker 库。 date_picker_theme.dart 文件有以下代码。

     class DateTimePickerTheme with DiagnosticableMixin {
      }
    

    在 Flutter 2.0 版本中,他们删除了 falvor DiagnosticableMixin。所以用 Diagnosticable 移除 DiagnosticableMixin。按照以下代码更改 date_picker_theme.dart 文件。

      class DateTimePickerTheme with Diagnosticable {
      }
    

    【讨论】:

      猜你喜欢
      • 2021-08-21
      • 2021-03-20
      • 2021-11-13
      • 2021-11-26
      • 2019-09-17
      • 2020-07-22
      • 2019-10-25
      • 2022-10-18
      • 1970-01-01
      相关资源
      最近更新 更多