flutter / samples

A collection of Flutter examples and demos

Home Page:https://flutter.github.io/samples/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter 3 - PlatformMenuBar & Menubar

drandell opened this issue · comments

Hi,

A great example showcasing the use of the menubar functionality via windows.
After upgrading to flutter 3.0 we now have a conflict between ;

  • package:flutter/src/widgets/platform_menu_bar.dart
  • package:menubar/src/menu_item.dart

I've tried adding an alias to the imports like so;

import 'package:flutter/src/widgets/platform_menu_bar.dart' as mac_menubar;
import 'package:menubar/menubar.dart' as win_menubar;

But still getting the error :/

/E:/flutter/.pub-cache/git/flutter-desktop-embedding-5c51870ced62a00e809ba4b81a846a052d241c9f/plugins/menubar/lib/src/menu_channel.dart(19,1): error G837C20CB: 'MenuItem' is imported from both 'package:flutter/src/widgets/platform_menu_bar.dart' and 'package:menubar/src/menu_item.dart'. [F:\IANC\ianc\build\windows\flutter\flutter_assemble.vcxproj]
E:\Visual Studio\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(240,5): error MSB8066: Custom build for 'F:\IANC\ianc\build\windows\CMakeFiles\686e42bf85f0b158384cd304fd240859\flutter_windows.dll.rule;F:\IANC\ianc\build\windows\CMakeFiles\a50e58320f73911c5397a69b1b29268e\flutter_assemble.rule' exited with code 1. [F:\IANC\ianc\build\windows\flutter\flutter_assemble.vcxproj]
Exception: Build process failed.

Hiding MenuItem in menu_channel.dart from the menubar package fixes this.

Can see this has been fixed now :) so closing