Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having problem implementing the modal_bottom_sheet library #390

Closed
lebe24 opened this issue Mar 2, 2024 · 5 comments
Closed

Having problem implementing the modal_bottom_sheet library #390

lebe24 opened this issue Mar 2, 2024 · 5 comments

Comments

@lebe24
Copy link

lebe24 commented Mar 2, 2024

hi everyone

this is my first time running this package, I have read the documentation and tried to implement the showCupertinoModalBottomSheet

for context

installation

import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';

implementation

 IconButton(icon: Icon(Icons.settings), 
            onPressed: () => showCupertinoModalBottomSheet(
                        expand: true,
                              context: context,
                              backgroundColor: Colors.transparent,
                        builder: (context) => Center(child: Text("test")),
                      ),
                    ),
          ],

error

./../AppData/Local/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';
^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/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<T>(
            ^^^^^^^^^^^^^^^^^^^^^
../../AppData/Local/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?>'.
 - 'Object' is from 'dart:core'.
 - 'Future' is from 'dart:async'.
  return result;
@MahitMehta
Copy link

@lebe24 Did you ever figure out a solution? I'm facing the same problem currently.

@lebe24
Copy link
Author

lebe24 commented Mar 6, 2024

Hey @MahitMehta the solutions seems to be modifying the bottom sheet file regarding the import. But basically am just waiting to see if a solution come up if not I probably figured the bug in the package. Right now I haven't found any fix, am just waiting...😐

@iamnabink
Copy link

Flutter version and package version please

@CyMathew
Copy link

CyMathew commented Mar 9, 2024

Change pubspec version manually to modal_bottom_sheet: ^3.0.0-pre

Also read the documentation on how to make iOS style modal transitions work. You will need MaterialWithModalsPageRoute on the route you're navigating from.

@lebe24
Copy link
Author

lebe24 commented Mar 10, 2024

Package version works 🥂 thanks @CyMathew @iamnabink

@lebe24 lebe24 closed this as completed Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants