macos_window_utils.dart icon indicating copy to clipboard operation
macos_window_utils.dart copied to clipboard

Consider offering a widget for window configuration

Open matthew-carroll opened this issue 1 year ago • 5 comments

As far as I can tell, based on the README documentation, all window configurations go through imperative static methods.

Consider offering a widget for most/all of these configurations. You don't need to remove the imperative configurations, but it might be a lot more natural for Flutter developers to consume these options as a widget.

Widget build(BuildContext context) {
  return MacWindow(
    initialSize: const Size(1000, 650),
    titlebarStyle: const MacWindowTitleBarStyle(
      transparent: true,
      hideTitle: true,
    ),
    fullSizeContentView: true,
    child: MaterialApp(
      home: MyHomePage(),
    ),
  );
}

By offering these capabilities as a widget, you don't need for developers to explicitly initialize the Flutter binding. You don't need developers to create a place for asynchronous execution. You don't need developers to leave the widget tree.

matthew-carroll avatar Jun 26 '23 09:06 matthew-carroll