-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weiguan部分container.dart报错 #6
Comments
我使用的是最新版fluttersdk,尝试降级后contiainer.dart不再报错,但是在运行weiguan/main.dart的时候报错
BUILD FAILED in 6s |
今天用网络的方法修改了shared_preferences后不在报相关错,但是运行weiguan的main.dart还是会报错。我用的flutter1.12 Sending crash report to Google. Crash report written to D:\AAAAA\flutter-in-practice-master\flutter_05.log; flutter_05.log exceptionNoSuchMethodError: NoSuchMethodError: The method 'containsKey' was called on null.
|
目前项目所用的 Flutter 版本已经比较老了,最近比较忙,暂时没有时间来升级到新版本。欢迎提交 Pull Request 来升级到最新的 Flutter 2,注意相关的第三方库估计也要升级。 |
错误信息
Launching lib/weiguan/main.dart on Redmi K20 Pro in debug mode...
/D:/fluttersdk/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-2.2.2/lib/src/dio_http_headers.dart:55:8: Error: The method 'DioHttpHeaders.add' has fewer named arguments than those of overridden method 'HttpH
eaders.add'.
void add(String name, value) {
^
org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:698:8: Context: This is the overridden method ('add').
void add(String name, Object value,
^
/D:/fluttersdk/flutter/.pub-cache/hosted/pub.flutter-io.cn/dio-2.2.2/lib/src/dio_http_headers.dart:70:8: Error: The method 'DioHttpHeaders.set' has fewer named arguments than those of overridden method 'HttpH
eaders.set'.
void set(String name, Object value) {
^
org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:707:8: Context: This is the overridden method ('set').
void set(String name, Object value,
^
lib/weiguan/container.dart:68:41: Error: The argument type 'Logger Function(dynamic)' can't be assigned to the parameter type 'Logger Function()'.
_injector.registerSingleton((injector) {return Logger('app');}, dependencyName: 'app');
^
lib/weiguan/container.dart:69:41: Error: The argument type 'Logger Function(dynamic)' can't be assigned to the parameter type 'Logger Function()'.
_injector.registerSingleton((injector) {
^
lib/weiguan/container.dart:72:41: Error: The argument type 'Logger Function(dynamic)' can't be assigned to the parameter type 'Logger Function()'.
_injector.registerSingleton((injector) {
^
lib/weiguan/container.dart:90:42: Error: The argument type 'WgTheme Function(dynamic)' can't be assigned to the parameter type 'WgTheme Function()'.
_injector.registerSingleton((injector) {
^
lib/weiguan/container.dart:100:44: Error: The argument type 'AppState Function(dynamic)' can't be assigned to the parameter type 'AppState Function()'.
_injector.registerDependency((injector) {
^
lib/weiguan/container.dart:112:50: Error: The argument type 'Store Function(dynamic)' can't be assigned to the parameter type 'Store Function()'.
_injector.registerSingleton<Store>((injector) {
^
lib/weiguan/container.dart:122:49: Error: The argument type 'WeiguanService Function(dynamic)' can't be assigned to the parameter type 'WeiguanService Function()'.
_injector.registerSingleton((injector) {
^
lib/weiguan/container.dart:159:47: Error: The argument type 'UserUsecases Function(dynamic)' can't be assigned to the parameter type 'UserUsecases Function()'.
_injector.registerSingleton((injector) {
^
lib/weiguan/container.dart:163:47: Error: The argument type 'PostUsecases Function(dynamic)' can't be assigned to the parameter type 'PostUsecases Function()'.
_injector.registerSingleton((injector) {
^
lib/weiguan/container.dart:177:48: Error: The argument type 'BasePresenter Function(dynamic)' can't be assigned to the parameter type 'BasePresenter Function()'.
_injector.registerSingleton((injector) {
^
lib/weiguan/container.dart:185:48: Error: The argument type 'UserPresenter Function(dynamic)' can't be assigned to the parameter type 'UserPresenter Function()'.
_injector.registerSingleton((injector) {
^
lib/weiguan/container.dart:194:48: Error: The argument type 'PostPresenter Function(dynamic)' can't be assigned to the parameter type 'PostPresenter Function()'.
_injector.registerSingleton((injector) {
^
FAILURE: Build failed with an exception.
Where:
Script 'D:\fluttersdk\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 56s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 58.5s
Exception: Gradle task assembleDebug failed with exit code 1
The text was updated successfully, but these errors were encountered: