jamesblasco / modal_bottom_sheet

Flutter | Create advanced modal bottom sheets. Material, Cupertino or your own style
https://pub.dev/packages/modal_bottom_sheet
MIT License
1.9k stars 477 forks source link

ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart' #291

Closed theappideasankit closed 2 years ago

theappideasankit commented 2 years ago

../../../.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.

BUILD FAILED in 46s Running Gradle task 'bundleRelease'... 47.2s Gradle task bundleRelease failed with exit code 1

yogeshPutman commented 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'.

jbankz commented 2 years ago

Same issue here, i am not even using the package

Screenshot 2022-11-14 at 11 25 54
jbankz commented 2 years ago

Same issue here, i am not even using the package

Screenshot 2022-11-14 at 11 25 54

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

PawelSzymanski89 commented 2 years ago

same here :(

theappideasankit commented 2 years ago
image

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

PawelSzymanski89 commented 2 years ago

Tested, works fine, thanks!