@@ -17,6 +17,7 @@ const kWindowEventMove = 'move';
1717const kWindowEventEnterFullScreen = 'enter-full-screen' ;
1818const kWindowEventLeaveFullScreen = 'leave-full-screen' ;
1919
20+ // WindowManager
2021class WindowManager {
2122 WindowManager ._() {
2223 _channel.setMethodCallHandler (_methodCallHandler);
@@ -93,6 +94,8 @@ class WindowManager {
9394 }
9495
9596 /// Removes focus from the window.
97+ ///
98+ /// @platforms macos,windows
9699 Future <void > blur ({bool inactive = false }) async {
97100 await _channel.invokeMethod ('blur' );
98101 }
@@ -114,12 +117,12 @@ class WindowManager {
114117 await _channel.invokeMethod ('hide' );
115118 }
116119
117- /// Returns bool - Whether the window is visible to the user.
120+ /// Returns ` bool` - Whether the window is visible to the user.
118121 Future <bool > isVisible () async {
119122 return await _channel.invokeMethod ('isVisible' );
120123 }
121124
122- /// Returns bool - Whether the window is maximized.
125+ /// Returns ` bool` - Whether the window is maximized.
123126 Future <bool > isMaximized () async {
124127 return await _channel.invokeMethod ('isMaximized' );
125128 }
@@ -134,7 +137,7 @@ class WindowManager {
134137 await _channel.invokeMethod ('unmaximize' );
135138 }
136139
137- /// Returns bool - Whether the window is minimized.
140+ /// Returns ` bool` - Whether the window is minimized.
138141 Future <bool > isMinimized () async {
139142 return await _channel.invokeMethod ('isMinimized' );
140143 }
@@ -149,7 +152,7 @@ class WindowManager {
149152 await _channel.invokeMethod ('restore' );
150153 }
151154
152- /// Returns bool - Whether the window is in fullscreen mode.
155+ /// Returns ` bool` - Whether the window is in fullscreen mode.
153156 Future <bool > isFullScreen () async {
154157 return await _channel.invokeMethod ('isFullScreen' );
155158 }
@@ -173,7 +176,7 @@ class WindowManager {
173176 await _channel.invokeMethod ('setBackgroundColor' , arguments);
174177 }
175178
176- /// Returns Rect - The bounds of the window as Object.
179+ /// Returns ` Rect` - The bounds of the window as Object.
177180 Future <Rect > getBounds () async {
178181 Offset position = await getPosition ();
179182 Size size = await getSize ();
@@ -186,7 +189,7 @@ class WindowManager {
186189 await setSize (bounds.size);
187190 }
188191
189- /// Returns Offset - Contains the window's current position.
192+ /// Returns ` Offset` - Contains the window's current position.
190193 Future <Offset > getPosition () async {
191194 final Map <String , dynamic > arguments = {
192195 'devicePixelRatio' : window.devicePixelRatio,
@@ -207,7 +210,7 @@ class WindowManager {
207210 await _channel.invokeMethod ('setPosition' , arguments);
208211 }
209212
210- /// Returns Size - Contains the window's width and height.
213+ /// Returns ` Size` - Contains the window's width and height.
211214 Future <Size > getSize () async {
212215 final Map <String , dynamic > arguments = {
213216 'devicePixelRatio' : window.devicePixelRatio,
@@ -217,7 +220,7 @@ class WindowManager {
217220 return Size (resultData['width' ], resultData['height' ]);
218221 }
219222
220- /// Resizes the window to width and height.
223+ /// Resizes the window to ` width` and ` height` .
221224 Future <void > setSize (Size size, {animate = false }) async {
222225 final Map <String , dynamic > arguments = {
223226 'devicePixelRatio' : window.devicePixelRatio,
@@ -228,6 +231,7 @@ class WindowManager {
228231 await _channel.invokeMethod ('setSize' , arguments);
229232 }
230233
234+ /// Sets the minimum size of window to `width` and `height` .
231235 Future <void > setMinimumSize (Size size) async {
232236 final Map <String , dynamic > arguments = {
233237 'devicePixelRatio' : window.devicePixelRatio,
@@ -237,6 +241,7 @@ class WindowManager {
237241 await _channel.invokeMethod ('setMinimumSize' , arguments);
238242 }
239243
244+ /// Sets the maximum size of window to `width` and `height` .
240245 Future <void > setMaximumSize (Size size) async {
241246 final Map <String , dynamic > arguments = {
242247 'devicePixelRatio' : window.devicePixelRatio,
@@ -246,64 +251,84 @@ class WindowManager {
246251 await _channel.invokeMethod ('setMaximumSize' , arguments);
247252 }
248253
254+ /// Returns `bool` - Whether the window can be manually resized by the user.
249255 Future <bool > isResizable () async {
250256 return await _channel.invokeMethod ('isResizable' );
251257 }
252258
259+ /// Sets whether the window can be manually resized by the user.
253260 setResizable (isResizable) {
254261 final Map <String , dynamic > arguments = {
255262 'isResizable' : isResizable,
256263 };
257264 _channel.invokeMethod ('setResizable' , arguments);
258265 }
259266
267+ /// Returns `bool` - Whether the window can be moved by user.
268+ ///
269+ /// @platforms macos
260270 Future <bool > isMovable () async {
261271 return await _channel.invokeMethod ('isMovable' );
262272 }
263273
274+ /// Sets whether the window can be moved by user.
275+ ///
276+ /// @platforms macos
264277 setMovable (isMovable) {
265278 final Map <String , dynamic > arguments = {
266279 'isMovable' : isMovable,
267280 };
268281 _channel.invokeMethod ('setMovable' , arguments);
269282 }
270283
284+ /// Returns `bool` - Whether the window can be manually minimized by the user.
285+ ///
286+ /// @platforms macos,windows
271287 Future <bool > isMinimizable () async {
272288 return await _channel.invokeMethod ('isMinimizable' );
273289 }
274290
291+ /// Sets whether the window can be manually minimized by user.
292+ ///
293+ /// @platforms macos,windows
275294 setMinimizable (isMinimizable) {
276295 final Map <String , dynamic > arguments = {
277296 'isMinimizable' : isMinimizable,
278297 };
279298 _channel.invokeMethod ('setMinimizable' , arguments);
280299 }
281300
301+ /// Returns `bool` - Whether the window can be manually closed by user.
302+ ///
303+ /// @platforms macos,windows
282304 Future <bool > isClosable () async {
283305 return await _channel.invokeMethod ('isClosable' );
284306 }
285307
308+ /// Sets whether the window can be manually closed by user.
309+ ///
310+ /// @platforms macos,windows
286311 Future <void > setClosable (bool isClosable) async {
287312 final Map <String , dynamic > arguments = {
288313 'isClosable' : isClosable,
289314 };
290315 await _channel.invokeMethod ('setClosable' , arguments);
291316 }
292317
293- /// Returns bool - Whether the window is always on top of other windows.
318+ /// Returns ` bool` - Whether the window is always on top of other windows.
294319 Future <bool > isAlwaysOnTop () async {
295320 return await _channel.invokeMethod ('isAlwaysOnTop' );
296321 }
297322
298- /// Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on.
323+ /// Sets whether the window should show always on top of other windows.
299324 Future <void > setAlwaysOnTop (bool isAlwaysOnTop) async {
300325 final Map <String , dynamic > arguments = {
301326 'isAlwaysOnTop' : isAlwaysOnTop,
302327 };
303328 await _channel.invokeMethod ('setAlwaysOnTop' , arguments);
304329 }
305330
306- /// Returns String - The title of the native window.
331+ /// Returns ` String` - The title of the native window.
307332 Future <String > getTitle () async {
308333 return await _channel.invokeMethod ('getTitle' );
309334 }
@@ -317,6 +342,8 @@ class WindowManager {
317342 }
318343
319344 /// Changes the title bar style of native window.
345+ ///
346+ /// @platforms macos,windows
320347 Future <void > setTitleBarStyle (
321348 String titleBarStyle, {
322349 bool windowButtonVisibility = true ,
@@ -328,6 +355,9 @@ class WindowManager {
328355 await _channel.invokeMethod ('setTitleBarStyle' , arguments);
329356 }
330357
358+ /// Returns `int` - The title bar height of the native window.
359+ ///
360+ /// @platforms macos,windows
331361 Future <int > getTitleBarHeight () async {
332362 return await _channel.invokeMethod ('getTitleBarHeight' );
333363 }
@@ -341,39 +371,50 @@ class WindowManager {
341371 }
342372
343373 /// Sets progress value in progress bar. Valid range is [0, 1.0] .
374+ ///
375+ /// @platforms macos
344376 Future <void > setProgressBar (double progress) async {
345377 final Map <String , dynamic > arguments = {
346378 'progress' : progress,
347379 };
348380 await _channel.invokeMethod ('setProgressBar' , arguments);
349381 }
350382
351- /// Returns bool - Whether the window has a shadow.
383+ /// Returns `bool` - Whether the window has a shadow.
384+ ///
385+ /// @platforms macos
352386 Future <bool > hasShadow () async {
353387 return await _channel.invokeMethod ('hasShadow' );
354388 }
355389
356390 /// Sets whether the window should have a shadow.
391+ ///
392+ /// @platforms macos
357393 Future <void > setHasShadow (bool hasShadow) async {
358394 final Map <String , dynamic > arguments = {
359395 'hasShadow' : hasShadow,
360396 };
361397 await _channel.invokeMethod ('setHasShadow' , arguments);
362398 }
363399
364- /// Returns double - between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1.
400+ /// Returns `double` - between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns 1.
401+ ///
402+ /// @platforms macos,windows
365403 Future <double > getOpacity () async {
366404 return await _channel.invokeMethod ('getOpacity' );
367405 }
368406
369407 /// Sets the opacity of the window.
408+ ///
409+ /// @platforms macos,windows
370410 Future <void > setOpacity (double opacity) async {
371411 final Map <String , dynamic > arguments = {
372412 'opacity' : opacity,
373413 };
374414 await _channel.invokeMethod ('setOpacity' , arguments);
375415 }
376416
417+ /// Starts a window drag based on the specified mouse-down event.
377418 Future <void > startDragging () async {
378419 await _channel.invokeMethod ('startDragging' );
379420 }
0 commit comments