Comments (5)
I find the glitch isn’t really as noticeable when running the app in release mode (it’s really just a fraction of a second), though it is indeed noticeable at all.
It might be possible how add functionality to hide/unhide the window and document how to make sure the window is hidden during startup by modifying the app’s Swift code. This way you’d still be able to configure your app within Dart, while the only thing you’d need to do in Swift would be making sure the window is hidden during launch.
from macos_window_utils.dart.
Is there a Swift and Dart code snippet that does what you described above? Or does this require new Dart APIs in this package?
from macos_window_utils.dart.
Honestly, I am no longer quite sure if you can even hide the window programmatically, but you can make it invisible by setting its alpha value to 0. So, you could achieve what you’re trying to do like this:
In your MainFlutterWindow.swift
file in your Xcode project, add this line to the awakeFromNib
method, right above super.awakeFromNib()
:
self.alphaValue = 0.0
This will ensure that your window is opened with an alpha value of 0.0. Then, use the WindowManipulator
’s setWindowAlphaValue
method to set it to 1.0 in your Dart code at startup.
from macos_window_utils.dart.
Adding the following line after the function awakeFromNib()
also works for hiding the app, though there's no method in this plugin to make it visible again, you need to add one in the plugin.
override public func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int) {
super.order(place, relativeTo: otherWin)
super.setIsVisible(false)
}
(Adapted from window_manager
)
from macos_window_utils.dart.
Oh, you’re right, I somehow missed the setVisible
method. Maybe I should expose that.
from macos_window_utils.dart.
Related Issues (20)
- All window styles doesn't work after upgrading Flutter to 3.7.0 HOT 2
- Expose `NSWindowDelegate` events
- Expose UI Element Colors HOT 1
- Add a method to check whether the plugin has been set up properly in the MainFlutterWindow.swift file. HOT 1
- macos_window_utils/MainFlutterWindowManipulator.swift:370: Fatal error: Unexpectedly found nil while unwrapping an Optional value HOT 1
- Fix typo in readme
- `'self' captured by a closure before all members were initialized`
- Flutter 3.10 - Exiting app doesn't work properly HOT 1
- Add query and mutation controls for the traffic light window buttons HOT 11
- Consider moving away from static methods HOT 1
- Consider offering a widget for window configuration HOT 5
- Create a TrafficLightsSafeArea widget HOT 2
- Expose `isMainWindow`.
- Make it possible to center the window on the screen HOT 3
- Let user's specify a static window size HOT 1
- Flutter view not showing on older MacOS versions HOT 3
- Because both the window_manager plug-in and this plug-in use NSWindowDelegate, there is an incompatibility problem between the two, which will cause all monitoring in window_manager to fail. This problem has been encountered in the macos_ui library. HOT 5
- deployment target 11.0 does not work HOT 1
- [Question] Transparency compatibility with desktop_multi_window HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macos_window_utils.dart.