0

i can't run my flutter web app , i got dependency error here is my flutter and dart version :

Flutter 3.7.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b06b8b2710 (1 year, 5 months ago) • 2023-01-23 16:55:55 -0800
Engine • revision b24591ed32
Tools • Dart 2.19.0 • DevTools 2.20.1

here is my pubspec.yml :

name: myApp
description: My Project

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=2.19.0 <3.0.0"
        dependencies:
      abg_utils: 8.0.8
      html_editor_enhanced: 2.5.1
      timeago: ^3.1.0
      maps_toolkit: ^2.0.0
      google_maps_flutter_web: 0.3.2+1
      google_maps_flutter: 2.1.1
      universal_html: 2.0.8
      soundpool: 2.2.0
      provider: 6.0.2
      image_picker: 0.8.4+7
      syncfusion_flutter_charts: 19.2.62


      flutter:
        sdk: flutter

      flutter_lints: ^1.0.4

      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      cupertino_icons: ^1.0.2

    dependency_overrides:
      platform: ^3.1.4
      win32: ^2.0.0
      device_info_plus: ^3.2.1
      device_info_plus_windows: ^2.1.1
      ffi: ^1.0.0
      firebase_core: ^2.5.0
      firebase_core_web: ^2.1.1
      firebase_messaging_web: ^3.2.12
      firebase_messaging_platform_interface: ^4.2.11
      firebase_messaging: ^14.2.2
      firebase_storage: ^11.0.11
      firebase_core_platform_interface: ^4.2.1
      #cloud_functions_web: ^4.7.0
      #cloud_functions: ^5.0.0


    dev_dependencies:
      flutter_test:
        sdk: flutter

    # For information on the generic Dart part of this file, see the
    # following page: https://dart.dev/tools/pub/pubspec

    # The following section is specific to Flutter.
    flutter:

      # The following line ensures that the Material Icons font is
      # included with your application, so that you can use the icons in
      # the material Icons class.
      uses-material-design: true

when i run flutter run -d chrome i got this error

Launching lib/main.dart on Chrome in debug mode...

../../../.pub-cache/hosted/pub.dev/platform-3.1.4/lib/platform.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // Copyright 2013 The Flutter Authors. All rights reserved. ^ ../../../.pub-cache/hosted/pub.dev/platform-3.1.4/lib/src/interface/local_platform.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // Copyright 2013 The Flutter Authors. All rights reserved. ^ ../../../.pub-cache/hosted/pub.dev/platform-3.1.4/lib/src/interface/platform.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // Copyright 2013 The Flutter Authors. All rights reserved. ^ ../../../.pub-cache/hosted/pub.dev/platform-3.1.4/lib/src/testing/fake_platform.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // Copyright 2013 The Flutter Authors. All rights reserved. ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/cloud_firestore_web.dart:53:29: Error: The method 'FirebaseFirestoreWeb.delegateFor' has fewer named arguments than those of overridden method 'FirebaseFirestorePlatform.delegateFor'. FirebaseFirestorePlatform delegateFor( ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_firestore.dart:68:29: Context: This is the overridden method ('delegateFor'). FirebaseFirestorePlatform delegateFor( ^ ../../../.pub-cache/hosted/pub.dev/firebase_auth_web-4.6.1/lib/firebase_auth_web.dart:123:27: Error: The parameter 'currentUser' of the method 'FirebaseAuthWeb.setInitialValues' has type 'Map<String, dynamic>?', which does not match the corresponding type, 'PigeonUserDetails?', in the overridden method, 'FirebaseAuthPlatform.setInitialValues'.

  • 'Map' is from 'dart:core'.
  • 'PigeonUserDetails' is from 'package:firebase_auth_platform_interface/src/pigeon/messages.pigeon.dart' ('../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-6.19.1/lib/src/pigeon/messages.pigeon.dart'). Change to a supertype of 'PigeonUserDetails?', or, for a covariant parameter, a subtype. Map<String, dynamic>? currentUser, ^ ../../../.pub-cache/hosted/pub.dev/firebase_auth_platform_interface-6.19.1/lib/src/platform_interface/platform_interface_firebase_auth.dart:99:24: Context: This is the overridden method ('setInitialValues'). FirebaseAuthPlatform setInitialValues({ ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:122:37: Error: The parameter 'fields' of the method 'QueryWeb.endAt' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.endAt'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype. QueryPlatform endAt(List fields) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:80:17: Context: This is the overridden method ('endAt'). QueryPlatform endAt(Iterable fields) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:130:49: Error: The parameter 'orders' of the method 'QueryWeb.endBeforeDocument' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.endBeforeDocument'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype. QueryPlatform endBeforeDocument(List orders, List values) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:98:17: Context: This is the overridden method ('endBeforeDocument'). QueryPlatform endBeforeDocument( ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:130:71: Error: The parameter 'values' of the method 'QueryWeb.endBeforeDocument' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.endBeforeDocument'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype. QueryPlatform endBeforeDocument(List orders, List values) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:98:17: Context: This is the overridden method ('endBeforeDocument'). QueryPlatform endBeforeDocument( ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:139:41: Error: The parameter 'fields' of the method 'QueryWeb.endBefore' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.endBefore'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype. QueryPlatform endBefore(List fields) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:111:17: Context: This is the overridden method ('endBefore'). QueryPlatform endBefore(Iterable fields) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:191:45: Error: The parameter 'orders' of the method 'QueryWeb.orderBy' has type 'List<List>', which does not match the corresponding type, 'Iterable<List>', in the overridden method, 'QueryPlatform.orderBy'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable<List>', or, for a covariant parameter, a subtype. QueryPlatform orderBy(List<List> orders) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:152:17: Context: This is the overridden method ('orderBy'). QueryPlatform orderBy(Iterable<List> orders) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:205:42: Error: The parameter 'fields' of the method 'QueryWeb.startAfter' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.startAfter'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype. QueryPlatform startAfter(List fields) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:182:17: Context: This is the overridden method ('startAfter'). QueryPlatform startAfter(Iterable fields) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:213:47: Error: The parameter 'orders' of the method 'QueryWeb.startAtDocument' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.startAtDocument'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype. QueryPlatform startAtDocument(List orders, List values) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:200:17: Context: This is the overridden method ('startAtDocument'). QueryPlatform startAtDocument( ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:213:69: Error: The parameter 'values' of the method 'QueryWeb.startAtDocument' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.startAtDocument'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype. QueryPlatform startAtDocument(List orders, List values) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:200:17: Context: This is the overridden method ('startAtDocument'). QueryPlatform startAtDocument( ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:222:39: Error: The parameter 'fields' of the method 'QueryWeb.startAt' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.startAt'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype. QueryPlatform startAt(List fields) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_platform_interface-5.16.2/lib/src/platform_interface/platform_interface_query.dart:213:17: Context: This is the overridden method ('startAt'). QueryPlatform startAt(Iterable fields) { ^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/collection_reference_web.dart:13:7: Error: The implementation of 'endAt' in the non-abstract class 'CollectionReferenceWeb' does not conform to its interface. class CollectionReferenceWeb extends QueryWeb ^^^^^^^^^^^^^^^^^^^^^^ ../../../.pub-cache/hosted/pub.dev/cloud_firestore_web-2.8.10/lib/src/query_web.dart:122:37: Context: The parameter 'fields' of the method 'QueryWeb.endAt' has type 'List', which does not match the corresponding type, 'Iterable', in the overridden method, 'QueryPlatform.endAt'.
  • 'List' is from 'dart:core'.
  • 'Iterable' is from 'dart:core'. Change to a supertype of 'Iterable', or, for a covariant parameter, a subtype...

any idea how to fix this

4
  • 1
    Your pubspec seems quite complicated. I'd get rid of all those dependency overrides, then try to use the latest version of each needed package, then fix the code to adapt to the changes in the packages, instead of trying to override things that maybe can't be really overriden Commented Jun 8, 2024 at 13:40
  • you are right , that is what i did , and no more error , thx Commented Jun 8, 2024 at 14:24
  • now when i am adding those : cloud_functions_web: ^4.6.16 cloud_functions: ^5.0.0 i got another error ./../../.pub-cache/hosted/pub.dev/cloud_functions_web-4.9.7/lib/cloud_functions_web.dart:1:1: Error: The specified language version is too high. The highest supported language version is 2.19. // ignore_for_file: require_trailing_commas Commented Jun 8, 2024 at 14:42
  • Is there any reason why your flutter and dart version are outdated? I see that Flutter is 3.7 and Dart 2.19, while the latest are 3.22 and 3.4.1 I'm guessing here, but maybe the latest versions of those packages won't work with older dart version... Commented Jun 10, 2024 at 8:38

1 Answer 1

-1

Run flutter pub get to download and install the updated dependencies.

Also, If you have flexibility with your project's requirements, consider downgrading Flutter to a version compatible with your current dependencies. Check the documentation for each dependency to find a compatible Flutter version.

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

2 Comments

i clean cach and run flutter pub get but still not working
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.