Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
import 'material.dart' hide ModalBottomSheetRoute;
The reason behind the error is says both material/bottom_sheet.dart
and bottom_sheet_route
exports the ModalBottomSheetRoute
.
'ModalBottomSheetRoute' is imported from both
'package:flutter/src/material/bottom_sheet.dart' and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
In order to fix this issue we have to hide one of the ModalBottomSheetRoute
. since we need this to be imported from bottom_sheet_route
we need to hide it from material
This is the way that we can fix,
Relace
import 'package:flutter/material.dart'
with
import 'package:flutter/material.dart' hide ModalBottomSheetRoute;
in the following files.
/Users/<usename>/.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/material_with_modal_page_route.dart
/Users/<usename>/.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/bar_bottom_sheet.dart
/Users/<usename>/.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.2/lib/src/bottom_sheets/material_bottom_sheet.dart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With