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

MenuItem conflict on Flutter 3.0 #18

Open
dodatw opened this issue May 13, 2022 · 6 comments
Open

MenuItem conflict on Flutter 3.0 #18

dodatw opened this issue May 13, 2022 · 6 comments

Comments

@dodatw
Copy link

dodatw commented May 13, 2022

After upgrade to Flutter 3.0, it have error:

../../.pub-cache/hosted/pub.dartlang.org/native_context_menu-0.2.1+4/lib/src/context_menu_region.dart:4:1: Error: 'MenuItem' is imported from both 'package:flutter/src/widgets/platform_menu_bar.dart' and 'package:native_context_menu/src/method_channel.dart'.

@lesnitsky
Copy link
Owner

you can use hide:

import 'package:flutter/material.dart' hide MenuItem;

@jmatth
Copy link
Contributor

jmatth commented May 13, 2022

The problem is that native_context_menu also contains a conflict from an import of flutter/material.dart. The issue needs to be fixed here in addition to end users updating their import statements. I already have a PR open at #17 to fix the issue on this end

@ilgnefz
Copy link

ilgnefz commented May 20, 2022

@lesnitsky Will this library be updated? It has been branded [UNIDENTIFIED] on pub.dev

@dodatw
Copy link
Author

dodatw commented May 20, 2022

Finally, I use another package,
https://pub.dev/packages/contextual_menu

@Adrian-Samoticha
Copy link

Finally, I use another package, https://pub.dev/packages/contextual_menu

That package has precisely the same issue. You still need to hide the MenuItem when importing material.dart.

@parcool
Copy link

parcool commented May 26, 2023

@Adrian-Samoticha Maybe you could try this one https://pub.dev/packages/native_context_menu_ng

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

6 participants