[英]Getting error DiagnosticableMixin after Update flutter SDK 2.0
After Update flutter SDK 2.0 i am getting below error.更新 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: Error: Type 'DiagnosticableMixin' not found. ../../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'不是成立。 class DateTimePickerTheme with 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: Error: The type 'DiagnosticableMixin' can't be mixed in. class DateTimePickerTheme with DiagnosticableMixin { ^../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cupertino_date_picker-1.0.26+2/lib/src/date_picker.dart:103:34: Error: No named parameter with the name 'shadowThemeOnly'. class DateTimePickerTheme with 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”类型。class DateTimePickerTheme with DiagnosticableMixin { ^-../。 cache/hosted/pub.dartlang.org/flutter_cupertino_date_picker-1.0.26+2/lib/src/date_picker.dart:103:34:错误:没有名为“shadowThemeOnly”的命名参数。 theme: Theme.of(context, shadowThemeOnly: true), ^^^^^^^^^^^^^^^../../SDK/flutter/packages/flutter/lib/src/material/theme.dart:107:20: Context: Found this candidate, but the arguments don't match.主题:Theme.of(context, shadowThemeOnly: true), ^^^^^^^^^^^^^^../../SDK/flutter/packages/flutter/lib/src/material/theme. dart:107:20:上下文:找到了这个候选,但 arguments 不匹配。 static ThemeData of(BuildContext context) { static ThemeData of(BuildContext context) {
check flutter_cupertino_date_picker lib.检查 flutter_cupertino_date_picker 库。 date_picker_theme.dart file have Below Code. date_picker_theme.dart 文件有以下代码。
class DateTimePickerTheme with DiagnosticableMixin {
}
In Flutter 2.0 version they remove falvor DiagnosticableMixin.在 Flutter 2.0 版本中,他们删除了 falvor DiagnosticableMixin。 so remove DiagnosticableMixin with Diagnosticable.所以用 Diagnosticable 移除 DiagnosticableMixin。 change date_picker_theme.dart file as per below code.按照以下代码更改 date_picker_theme.dart 文件。
class DateTimePickerTheme with Diagnosticable {
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.