flutter_shop icon indicating copy to clipboard operation
flutter_shop copied to clipboard

运行提示如下错误怎么解决?

Open AlgerSun opened this issue 4 years ago • 0 comments

Launching lib/main.dart on V2049A in debug mode... Running Gradle task 'assembleDebug'... ../../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 'HttpHeaders.add'. void add(String name, value) { ^ org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:699:8: Context: This is the overridden method ('add'). void add(String name, Object value, ^ ../../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 'HttpHeaders.set'. void set(String name, Object value) { ^ org-dartlang-sdk:///third_party/dart/sdk/lib/_http/http.dart:708:8: Context: This is the overridden method ('set'). void set(String name, Object value, ^ lib/main.dart:41:45: Error: The getter 'generator' isn't defined for the class 'Router'.

  • 'Router' is from 'package:flutter/src/widgets/router.dart' ('../../flutter/packages/flutter/lib/src/widgets/router.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'generator'. onGenerateRoute: Application.router.generator, ^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/provide-1.0.2/lib/provide.dart:570:28: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'. final widget = context.inheritFromWidgetOfExactType(_InheritedProviders); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/routers/routers.dart:9:12: Error: The setter 'notFoundHandler' isn't defined for the class 'Router'.
  • 'Router' is from 'package:flutter/src/widgets/router.dart' ('../../flutter/packages/flutter/lib/src/widgets/router.dart'). Try correcting the name to the name of an existing setter, or defining a setter or field named 'notFoundHandler'. router.notFoundHandler = new Handler( ^^^^^^^^^^^^^^^ lib/routers/routers.dart:14:12: Error: The method 'define' isn't defined for the class 'Router'.
  • 'Router' is from 'package:flutter/src/widgets/router.dart' ('../../flutter/packages/flutter/lib/src/widgets/router.dart'). Try correcting the name to the name of an existing method, or defining a method named 'define'. router.define(detailsPage,handler: detailsHandler); ^^^^^^ lib/pages/home_page.dart:123:34: Error: The method 'navigateTo' isn't defined for the class 'Router'.
  • 'Router' is from 'package:flutter/src/widgets/router.dart' ('../../flutter/packages/flutter/lib/src/widgets/router.dart'). Try correcting the name to the name of an existing method, or defining a method named 'navigateTo'. Application.router.navigateTo(context, "./detail?id=${val['goodsId']}"); ^^^^^^^^^^ lib/pages/home_page.dart:186:34: Error: The method 'navigateTo' isn't defined for the class 'Router'.
  • 'Router' is from 'package:flutter/src/widgets/router.dart' ('../../flutter/packages/flutter/lib/src/widgets/router.dart'). Try correcting the name to the name of an existing method, or defining a method named 'navigateTo'. Application.router.navigateTo(context, "./detail?id=${swiperDateList[index]['goodsId']}"); ^^^^^^^^^^ lib/pages/home_page.dart:326:29: Error: The method 'navigateTo' isn't defined for the class 'Router'.
  • 'Router' is from 'package:flutter/src/widgets/router.dart' ('../../flutter/packages/flutter/lib/src/widgets/router.dart'). Try correcting the name to the name of an existing method, or defining a method named 'navigateTo'. Application.router.navigateTo(context, "./detail?id=${recommendList[index]['goodsId']}"); ^^^^^^^^^^ lib/pages/home_page.dart:414:29: Error: The method 'navigateTo' isn't defined for the class 'Router'.
  • 'Router' is from 'package:flutter/src/widgets/router.dart' ('../../flutter/packages/flutter/lib/src/widgets/router.dart'). Try correcting the name to the name of an existing method, or defining a method named 'navigateTo'. Application.router.navigateTo(context, "./detail?id=${goods['goodsId']}"); ^^^^^^^^^^ lib/pages/category_page.dart:365:28: Error: The method 'navigateTo' isn't defined for the class 'Router'.
  • 'Router' is from 'package:flutter/src/widgets/router.dart' ('../../flutter/packages/flutter/lib/src/widgets/router.dart'). Try correcting the name to the name of an existing method, or defining a method named 'navigateTo'. Application.router.navigateTo(context, "./detail?id=${newList[index].goodsId}"); ^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/chewie-0.9.10/lib/src/chewie_player.dart:83:7: Error: No named parameter with the name 'resizeToAvoidBottomPadding'. resizeToAvoidBottomPadding: false, ^^^^^^^^^^^^^^^^^^^^^^^^^^ ../../flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match. const Scaffold({ ^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/chewie-0.9.10/lib/src/chewie_player.dart:276:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'. context.inheritFromWidgetOfExactType(_ChewieControllerProvider) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/chewie_audio-1.0.0+1/lib/src/chewie_player.dart:101:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
  • 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart'). Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'. context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ../../flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_svg-0.18.1/lib/src/picture_provider.dart:50:59: Error: No named parameter with the name 'nullOk'. context != null ? Localizations.localeOf(context, nullOk: true) : null, ^^^^^^ ../../flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match. static Locale localeOf(BuildContext context) { ^^^^^^^^

AlgerSun avatar May 08 '21 08:05 AlgerSun