android - 更新颤振 SDK 2.0 后出现错误 DiagnosticableMixin
问题描述
更新颤振 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”类型。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:错误:没有名为“shadowThemeOnly”的命名参数。主题:Theme.of(context, shadowThemeOnly: true), ^^^^^^^^^^^^^^ ../../SDK/flutter/packages/flutter/lib/src/material/theme.飞镖:107:20:上下文:找到了这个候选人,但论点不匹配。(BuildContext上下文)的静态主题数据{
解决方案
检查 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 {
}
推荐阅读
- linux - 试图从管道输出 grep 文件路径
- git - Github 推送不影响当前 repo 状态的更改
- ruby-on-rails-4 - Rspec 测试是否在 activeadmin 中删除了新操作
- dialogflow-es - 如何使用nodejs在diagflow中根据用户查询向用户发送响应
- css - 如何以声明方式注入基于主机的 css 内容脚本?
- android - 如何复制二维数组以使内容指向相同的位置;java.lang.NullPointerException:尝试写入空数组
- laravel - Laravel Passport Personal Access Token Expiration for some specific Token
- docker - 在 Docker 安装和卸载后让 Vagrant Homstead 恢复生机
- alarmmanager - 公共类 AlarmManager 时间间隔执行少于 15 分钟(例如 2 分钟、5 分钟、7 分钟或 10 分钟)
- mysql - 根据数据组合两个具有不同日期值的表