-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider offering a widget for window configuration #29
Comments
I can see how that would make things a little bit easier in some cases but at the same time, it kind of makes it look as if the Additionally, an app might listen to window events through an |
This isn't really different than
In those cases, developers can choose not to use the widget. But why prevent all other use-cases from gaining the clarity and simplicity? |
I am fairly certain that it’s possible to have multiple
If a developer decides to react to, say, full-screen events by dynamically removing the title bar when the app enters fullscreen, but they only realized that they needed to do so after already having decided to use the newly proposed widget, they would now need to migrate away from the widget to the lower-level method that already existed beforehand. This would add significant refactoring overhead, especially if they never bothered to familiarize themselves with the lower-level API. I don’t think running methods from your |
Ok, I think we're getting a bit abstract and hypothetical, so I'll return this point to what I can say about myself, with certainty. I would much prefer to establish window configurations from a top-level widget, when possible. I'm not worried about accidentally repeating the widget elsewhere - I can follow documentation that tells me not to. My current use-cases don't need the delegate. Maybe some of them will at some point, but none of them need it now, and some of them may never need it. There could be any number of API decisions related to this capability. I'm happy to get into the details. But those details don't matter very much if this request is perceived as low-value. So I'd like to first make clear the value to me, and the fact that I would prefer a widget option for cases where it's appropriate. |
My point wasn’t hypothetical at all — what I described is exactly what happened when developing the macos_ui example app. Honestly, I am not very convinced of the idea for the reasons I mentioned above, however, if you wish to configure your window without leaving the widget tree, there are other ways to do so. You could wrap your app in a This way, you could use the already-present API, while still remaining inside your widget tree. |
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.
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.
The text was updated successfully, but these errors were encountered: