6

i run this command in flutter: "flutter pub run build_runner watch" it is happening only in one project and rest all fine

error :

../../flutter-dart/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.1.0/lib/src/multi_headers.dart:97:8: Error: The method 'MultiHeaders.add' has fewer named arguments tha
n those of overridden method 'HttpHeaders.add'.
  void add(String name, Object value) {
       ^
org-dartlang-sdk:///sdk/lib/_http/http.dart:694:8: Context: This is the overridden method ('add').
  void add(String name, Object value,
       ^
../../flutter-dart/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.1.0/lib/src/multi_headers.dart:129:8: Error: The method 'MultiHeaders.set' has fewer named arguments th
an those of overridden method 'HttpHeaders.set'.
  void set(String name, Object value) {
       ^
org-dartlang-sdk:///sdk/lib/_http/http.dart:703:8: Context: This is the overridden method ('set').
  void set(String name, Object value,
       ^
pub finished with exit code 1

4 Answers 4

16

I guess you have upgraded flutter to the latest version.You should run the following command and also check pubspec.yaml file if build_runner is at the latest version, at this very writing time which is 1.8.1,you can check the latest version here.

flutter pub upgrade
Sign up to request clarification or add additional context in comments.

Comments

1

Add this to your package's pubspec.yaml file, if you don't want to update all your packages to solve this problem:

dependencies:
  http_multi_server: ^2.2.0

This upgrades just http_multi_server.

Comments

0

You should run flutter pub upgrade...it needs to upgrade you pub files

Comments

0

Run the command:

flutter pub upgrade

It will resolve the dependencies. To see outdated dependencies with more information try:

flutter pub outdated

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.