Closed theappideasankit closed 2 years ago
We are also having similar issue even though we are not using the pacakage. Error (Xcode): /Users/yogesh/.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/material_with_modal_page_route.dart:5:1: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
Same issue here, i am not even using the package
Same issue here, i am not even using the package
Prior to the above error, I noticed i wasn't using this package https://pub.dev/packages/modal_bottom_sheet, but another package entire was dependent on it which in this case was this https://pub.dev/packages/country_code_picker
so what i did was to remove the package as it is been discontinued.
Then i ran the following commands and it worked.
flutter clean
flutter pub get
same here :(
add this code your pubspec file
modal_bottom_sheet: git: url: https://github.com/CoolDude53/modal_bottom_sheet.git ref: main path: modal_bottom_sheet
Tested, works fine, thanks!
../../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/material_with_modal_page_route.dart:4:1: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'. import '../modal_bottom_sheet.dart'; ^^^^^^^^^^^^^^^^^^^^^ ../../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/material_bottom_sheet.dart:28:13: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'. .push(ModalBottomSheetRoute(
^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/material_bottom_sheet.dart:50:10: Error: A value of type 'Object?' can't be returned from an async function with return type 'Future<T?>'.
../../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/bar_bottom_sheet.dart:125:10: Error: A value of type 'Object?' can't be returned from an async function with return type 'Future<T?>'.
FAILURE: Build failed with an exception.
Where: Script '/Users/admin/Downloads/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1165
What went wrong: Execution failed for task ':app:compileFlutterBuildRelease'.
Try:
Get more help at https://help.gradle.org
BUILD FAILED in 46s Running Gradle task 'bundleRelease'... 47.2s Gradle task bundleRelease failed with exit code 1