问题描述
在更新flutter SDK 2.0之后,我遇到了以下错误.
After Update flutter SDK 2.0 i am getting below error.
../../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.带有DiagnosticableMixin的类DateTimePickerTheme {^^^^^^^^^^^^^^^^^^^^../../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"类型不能混入.带有DiagnosticableMixin的类DateTimePickerTheme {^../../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:上下文:找到了该候选者,但参数不匹配.(BuildContext context){
../../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.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'.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.static ThemeData of(BuildContext context) {
推荐答案
检查flutter_cupertino_date_picker库.date_picker_theme.dart文件具有以下代码.
check flutter_cupertino_date_picker lib. date_picker_theme.dart file have Below Code.
class DateTimePickerTheme with DiagnosticableMixin {
}
在Flutter 2.0版本中,它们删除了falvor DiagnosticableMixin.因此,请使用Diagnosticable删除DiagnosticableMixin.按照以下代码更改date_picker_theme.dart文件.
In Flutter 2.0 version they remove falvor DiagnosticableMixin. so remove DiagnosticableMixin with Diagnosticable. change date_picker_theme.dart file as per below code.
class DateTimePickerTheme with Diagnosticable {
}
这篇关于更新flutter SDK 2.0后出现错误DiagnosticableMixin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!