I have upgraded my flutter version from 3.3.10 to 3.7.0 and now getting the following error.
ModalBottomSheetRoute’ is imported from both ‘package:flutter/src/material/bottom_sheet.dart’ and ‘package:modal_bottom_sheet/src/bottom_sheet_route.dart
I tried to follow this Error: 'ModalBottomSheetRoute' is imported from both but solutions didn’t work for me.
3
Answers
Make Sure you follow the Migration Guide for flutter 3.7
modal_bottom_sheet:
Update to modal_bottom_sheet: ^3.0.0-pre
Rename any ModalBottomSheetRoute class reference to ModalSheetRoute
sheet:
have a look at the below link:
https://github.com/jamesblasco/modal_bottom_sheet/issues/325
After the Flutter 3.7 update, my project started getting this error, however I don’t use the
ModalBottomSheet
package, at least not directly, a another package I’m using, might be using it, so for now, the workaround (while a formal fix is in place) I added the following dependency override in thepubspec
file, and problem solved