import Cocoa
import FlutterMacOS

class MainFlutterWindow: NSWindow {
  override func awakeFromNib() {
    let flutterViewController = FlutterViewController()
    self.contentViewController = flutterViewController
    RegisterGeneratedPlugins(registry: flutterViewController)

    // Here, we set the window size to resemble a mobile device
    let windowSize = NSSize(width: 400, height: 800)
    var frame = self.frame
    frame.size = windowSize
    
    // Set the window to the new size and center it
    self.setFrame(frame, display: true)
    
    // Optional: Lock the aspect ratio so it always looks like a phone
    self.contentAspectRatio = windowSize

    super.awakeFromNib()
  }
}