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 clash with flutter widget of the same name #178

Open
avioli opened this issue Jan 12, 2023 · 1 comment
Open

MenuItem clash with flutter widget of the same name #178

avioli opened this issue Jan 12, 2023 · 1 comment

Comments

@avioli
Copy link

avioli commented Jan 12, 2023

Running the examples:

[ +745 ms] ../../../../../../lib/main_window.dart:7:1: Error: 'MenuItem' is imported from both 'package:flutter/src/widgets/platform_menu_bar.dart' and 'package:nativeshell/src/menu.dart'.
  [        ] import 'package:nativeshell/nativeshell.dart';
@avioli
Copy link
Author

avioli commented Jan 12, 2023

Fixed the MenuItem issue, but still getting an error. Let me know if you would like a PR for these. Feel free to close.

diff --git a/lib/main.dart b/lib/main.dart
index d98e17f..83dc863 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,4 +1,4 @@
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart' hide MenuItem;
 import 'package:flutter/rendering.dart';
 import 'package:nativeshell/nativeshell.dart';
 
diff --git a/lib/main_window.dart b/lib/main_window.dart
index 16e3f81..a4eab13 100644
--- a/lib/main_window.dart
+++ b/lib/main_window.dart
@@ -1,9 +1,9 @@
 import 'dart:io';
 
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart' hide MenuItem;
 import 'package:flutter/painting.dart';
 import 'package:flutter/rendering.dart';
-import 'package:flutter/widgets.dart';
+import 'package:flutter/widgets.dart' hide MenuItem;
 import 'package:nativeshell/nativeshell.dart';
 import 'package:nativeshell_examples/pages/flutter_plugins.dart';
 
diff --git a/lib/pages/menu.dart b/lib/pages/menu.dart
index 80621ef..993d4f8 100644
--- a/lib/pages/menu.dart
+++ b/lib/pages/menu.dart
@@ -1,7 +1,7 @@
 import 'dart:async';
 import 'dart:io';
 
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart' hide MenuItem;
 import 'package:nativeshell/accelerators.dart';
 import 'package:nativeshell/nativeshell.dart';
 

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

1 participant