Closed Moosphan closed 2 years ago
My code of AppBar is:
AppBar
return MoveWindow( child: Row( children: [ WindowButtons(), Padding( padding: EdgeInsets.only(left: 28.0), child: Text(Constants.windowTitle, style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold ),), ), ], ), );
MainFlutterWindow.swift code:
MainFlutterWindow.swift
import Cocoa import FlutterMacOS import bitsdojo_window_macos class MainFlutterWindow: BitsdojoWindow { override func awakeFromNib() { let flutterViewController = FlutterViewController.init() let windowFrame = self.frame self.contentViewController = flutterViewController self.setFrame(windowFrame, display: true) RegisterGeneratedPlugins(registry: flutterViewController) super.awakeFromNib() } override func bitsdojo_window_configure() -> UInt { return BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP } }
After running my app on macos, it looked like this:
You can see that the title in Row has already been shown, but these WindowButtons has never shown successfully.
This is because WindowButton is not showing up on Mac. Check out this line in the source code:
WindowButton
https://github.com/bitsdojo/bitsdojo_window/blob/f320b623db107b03a5976fd88e52ec4fe81fa0c9/bitsdojo_window/lib/src/widgets/window_button.dart#L94
However, you can implement any widget and use the WindowButton as an inspiration.
My code of
AppBar
is:MainFlutterWindow.swift
code:After running my app on macos, it looked like this:
You can see that the title in Row has already been shown, but these WindowButtons has never shown successfully.