mynameiskenlee / flutter_macos_menubar_example

starter template for building macOS menubar app with flutter and AppKit
https://www.reddit.com/r/FlutterDev/comments/g7aavn/creating_a_menubar_app_for_macos/
131 stars 15 forks source link

Black Window appears for a microsecond when app is started #17

Open triggerfx opened 5 months ago

triggerfx commented 5 months ago

Whenever I start the app (debug and release) for a moment there appears a black window before it jumps up to the menu bar.

mynameiskenlee commented 5 months ago

Hi @triggerfx,

Thanks for raising this, this is intended as flutter does not support embedding flutter view to native app in macOS. A new flutter window with the flutter view controller is created when flutter starts.

I have to mock the embedding by moving the flutter view controller to the native part (menu bar) when the app starts, and then close the window. That's why a black window is appears when app start.

There is also a feature request raised in the official flutter repo for implementing flutter to macOS menu bar. You may take it a look. Flutter Desktop: Allow using native Flutter widgets in MenuBar applications

Best, Ken