Skip to content

Commit 7aa5f53

Browse files
committed
chore: Update README.md
1 parent 854ea08 commit 7aa5f53

File tree

4 files changed

+101
-10
lines changed

4 files changed

+101
-10
lines changed

README-ZH.md

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# window_manager
22

3-
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] ![][visits-count-image] [![All Contributors][all-contributors-image]](#contributors)
3+
[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] [![All Contributors][all-contributors-image]](#contributors)
44

55
[pub-image]: https://img.shields.io/pub/v/window_manager.svg
66
[pub-url]: https://pub.dev/packages/window_manager
77

88
[discord-image]: https://img.shields.io/discord/884679008049037342.svg
99
[discord-url]: https://discord.gg/zPa6EZ2jqb
1010

11-
[visits-count-image]: https://img.shields.io/badge/dynamic/json?label=Visits%20Count&query=value&url=https://api.countapi.xyz/hit/leanflutter.window_manager/visits
1211
[all-contributors-image]: https://img.shields.io/github/all-contributors/leanflutter/window_manager?color=ee8449&style=flat-square
1312

1413
这个插件允许 Flutter 桌面应用调整窗口的大小和位置。
@@ -58,6 +57,10 @@
5857
- [restore](#restore)
5958
- [isFullScreen](#isfullscreen)
6059
- [setFullScreen](#setfullscreen)
60+
- [isDockable `windows`](#isdockable--windows)
61+
- [isDocked `windows`](#isdocked--windows)
62+
- [dock `windows`](#dock--windows)
63+
- [undock `windows`](#undock--windows)
6164
- [setAspectRatio](#setaspectratio)
6265
- [setBackgroundColor](#setbackgroundcolor)
6366
- [setAlignment](#setalignment)
@@ -77,13 +80,13 @@
7780
- [isMinimizable `macos` `windows`](#isminimizable--macos--windows)
7881
- [setMinimizable `macos` `windows`](#setminimizable--macos--windows)
7982
- [isClosable `windows`](#isclosable--windows)
80-
- [isMaximizable `macos` `windows`](#ismaximizable--macos--windows)
83+
- [isMaximizable `macos` `windows`](#ismaximizable--macos--windows)
8184
- [setMaximizable](#setmaximizable)
8285
- [setClosable `macos` `windows`](#setclosable--macos--windows)
8386
- [isAlwaysOnTop](#isalwaysontop)
8487
- [setAlwaysOnTop](#setalwaysontop)
8588
- [isAlwaysOnBottom](#isalwaysonbottom)
86-
- [setAlwaysOnBottom `linux` `windows`](#setalwaysonbottom--linux--windows)
89+
- [setAlwaysOnBottom `linux` `windows`](#setalwaysonbottom--linux--windows)
8790
- [getTitle](#gettitle)
8891
- [setTitle](#settitle)
8992
- [setTitleBarStyle](#settitlebarstyle)
@@ -92,6 +95,9 @@
9295
- [setSkipTaskbar](#setskiptaskbar)
9396
- [setProgressBar `macos` `windows`](#setprogressbar--macos--windows)
9497
- [setIcon `windows`](#seticon--windows)
98+
- [isVisibleOnAllWorkspaces `macos`](#isvisibleonallworkspaces--macos)
99+
- [setVisibleOnAllWorkspaces `macos`](#setvisibleonallworkspaces--macos)
100+
- [setBadgeLabel `macos`](#setbadgelabel--macos)
95101
- [hasShadow `macos` `windows`](#hasshadow--macos--windows)
96102
- [setHasShadow `macos` `windows`](#sethasshadow--macos--windows)
97103
- [getOpacity](#getopacity)
@@ -117,7 +123,10 @@
117123
- [onWindowMoved `macos` `windows`](#onwindowmoved--macos--windows)
118124
- [onWindowEnterFullScreen](#onwindowenterfullscreen)
119125
- [onWindowLeaveFullScreen](#onwindowleavefullscreen)
126+
- [onWindowDocked `windows`](#onwindowdocked--windows)
127+
- [onWindowUndocked `windows`](#onwindowundocked--windows)
120128
- [onWindowEvent](#onwindowevent)
129+
- [贡献者](#%E8%B4%A1%E7%8C%AE%E8%80%85)
121130
- [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81)
122131

123132
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -467,8 +476,8 @@ class HomePage extends StatefulWidget {
467476
class _HomePageState extends State<HomePage> with WindowListener {
468477
@override
469478
void initState() {
470-
windowManager.addListener(this);
471479
super.initState();
480+
windowManager.addListener(this);
472481
}
473482
474483
@override
@@ -593,6 +602,26 @@ Returns `bool` - Whether the window is in fullscreen mode.
593602

594603
Sets whether the window should be in fullscreen mode.
595604

605+
##### isDockable `windows`
606+
607+
Returns `bool` - Whether the window is dockable or not.
608+
609+
610+
##### isDocked `windows`
611+
612+
Returns `bool` - Whether the window is docked.
613+
614+
615+
##### dock `windows`
616+
617+
Docks the window. only works on Windows
618+
619+
620+
##### undock `windows`
621+
622+
Undocks the window. only works on Windows
623+
624+
596625
##### setAspectRatio
597626

598627
This will make a window maintain an aspect ratio.
@@ -674,7 +703,7 @@ Sets whether the window can be manually minimized by user.
674703
Returns `bool` - Whether the window can be manually closed by user.
675704

676705

677-
##### isMaximizable `windows`
706+
##### isMaximizable `macos` `windows`
678707

679708
Returns `bool` - Whether the window can be manually maximized by the user.
680709

@@ -870,6 +899,16 @@ Emitted when the window enters a full-screen state.
870899

871900
Emitted when the window leaves a full-screen state.
872901

902+
##### onWindowDocked `windows`
903+
904+
Emitted when the window entered a docked state.
905+
906+
907+
##### onWindowUndocked `windows`
908+
909+
Emitted when the window leaves a docked state.
910+
911+
873912
##### onWindowEvent
874913

875914
Emitted all events.

README.md

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ English | [简体中文](./README-ZH.md)
5858
- [restore](#restore)
5959
- [isFullScreen](#isfullscreen)
6060
- [setFullScreen](#setfullscreen)
61+
- [isDockable `windows`](#isdockable--windows)
62+
- [isDocked `windows`](#isdocked--windows)
63+
- [dock `windows`](#dock--windows)
64+
- [undock `windows`](#undock--windows)
6165
- [setAspectRatio](#setaspectratio)
6266
- [setBackgroundColor](#setbackgroundcolor)
6367
- [setAlignment](#setalignment)
@@ -77,13 +81,13 @@ English | [简体中文](./README-ZH.md)
7781
- [isMinimizable `macos` `windows`](#isminimizable--macos--windows)
7882
- [setMinimizable `macos` `windows`](#setminimizable--macos--windows)
7983
- [isClosable `windows`](#isclosable--windows)
80-
- [isMaximizable `macos` `windows`](#ismaximizable--macos--windows)
84+
- [isMaximizable `macos` `windows`](#ismaximizable--macos--windows)
8185
- [setMaximizable](#setmaximizable)
8286
- [setClosable `macos` `windows`](#setclosable--macos--windows)
8387
- [isAlwaysOnTop](#isalwaysontop)
8488
- [setAlwaysOnTop](#setalwaysontop)
8589
- [isAlwaysOnBottom](#isalwaysonbottom)
86-
- [setAlwaysOnBottom `linux` `windows`](#setalwaysonbottom--linux--windows)
90+
- [setAlwaysOnBottom `linux` `windows`](#setalwaysonbottom--linux--windows)
8791
- [getTitle](#gettitle)
8892
- [setTitle](#settitle)
8993
- [setTitleBarStyle](#settitlebarstyle)
@@ -92,6 +96,9 @@ English | [简体中文](./README-ZH.md)
9296
- [setSkipTaskbar](#setskiptaskbar)
9397
- [setProgressBar `macos` `windows`](#setprogressbar--macos--windows)
9498
- [setIcon `windows`](#seticon--windows)
99+
- [isVisibleOnAllWorkspaces `macos`](#isvisibleonallworkspaces--macos)
100+
- [setVisibleOnAllWorkspaces `macos`](#setvisibleonallworkspaces--macos)
101+
- [setBadgeLabel `macos`](#setbadgelabel--macos)
95102
- [hasShadow `macos` `windows`](#hasshadow--macos--windows)
96103
- [setHasShadow `macos` `windows`](#sethasshadow--macos--windows)
97104
- [getOpacity](#getopacity)
@@ -117,7 +124,10 @@ English | [简体中文](./README-ZH.md)
117124
- [onWindowMoved `macos` `windows`](#onwindowmoved--macos--windows)
118125
- [onWindowEnterFullScreen](#onwindowenterfullscreen)
119126
- [onWindowLeaveFullScreen](#onwindowleavefullscreen)
127+
- [onWindowDocked `windows`](#onwindowdocked--windows)
128+
- [onWindowUndocked `windows`](#onwindowundocked--windows)
120129
- [onWindowEvent](#onwindowevent)
130+
- [Contributors](#contributors)
121131
- [License](#license)
122132

123133
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -593,6 +603,26 @@ Returns `bool` - Whether the window is in fullscreen mode.
593603

594604
Sets whether the window should be in fullscreen mode.
595605

606+
##### isDockable `windows`
607+
608+
Returns `bool` - Whether the window is dockable or not.
609+
610+
611+
##### isDocked `windows`
612+
613+
Returns `bool` - Whether the window is docked.
614+
615+
616+
##### dock `windows`
617+
618+
Docks the window. only works on Windows
619+
620+
621+
##### undock `windows`
622+
623+
Undocks the window. only works on Windows
624+
625+
596626
##### setAspectRatio
597627

598628
This will make a window maintain an aspect ratio.
@@ -674,7 +704,7 @@ Sets whether the window can be manually minimized by user.
674704
Returns `bool` - Whether the window can be manually closed by user.
675705

676706

677-
##### isMaximizable `windows`
707+
##### isMaximizable `macos` `windows`
678708

679709
Returns `bool` - Whether the window can be manually maximized by the user.
680710

@@ -870,6 +900,16 @@ Emitted when the window enters a full-screen state.
870900

871901
Emitted when the window leaves a full-screen state.
872902

903+
##### onWindowDocked `windows`
904+
905+
Emitted when the window entered a docked state.
906+
907+
908+
##### onWindowUndocked `windows`
909+
910+
Emitted when the window leaves a docked state.
911+
912+
873913
##### onWindowEvent
874914

875915
Emitted all events.

lib/src/window_listener.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ abstract class WindowListener {
4343
void onWindowLeaveFullScreen() {}
4444

4545
/// Emitted when the window entered a docked state.
46+
///
47+
/// @platforms windows
4648
void onWindowDocked() {}
4749

4850
/// Emitted when the window leaves a docked state.
51+
///
52+
/// @platforms windows
4953
void onWindowUndocked() {}
5054

5155
/// Emitted all events.

lib/src/window_manager.dart

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,15 @@ class WindowManager {
269269
}
270270

271271
/// Returns `bool` - Whether the window is dockable or not.
272+
///
273+
/// @platforms windows
272274
Future<bool> isDockable() async {
273275
return await _channel.invokeMethod('isDockable');
274276
}
275277

276278
/// Returns `bool` - Whether the window is docked.
279+
///
280+
/// @platforms windows
277281
Future<DockSide?> isDocked() async {
278282
int? docked = await _channel.invokeMethod('isDocked');
279283
if (docked == 0) return null;
@@ -283,6 +287,8 @@ class WindowManager {
283287
}
284288

285289
/// Docks the window. only works on Windows
290+
///
291+
/// @platforms windows
286292
Future<void> dock({required DockSide side, required int width}) async {
287293
final Map<String, dynamic> arguments = {
288294
'left': side == DockSide.left,
@@ -293,6 +299,8 @@ class WindowManager {
293299
}
294300

295301
/// Undocks the window. only works on Windows
302+
///
303+
/// @platforms windows
296304
Future<bool> undock() async {
297305
return await _channel.invokeMethod('undock');
298306
}
@@ -477,7 +485,7 @@ class WindowManager {
477485

478486
/// Returns `bool` - Whether the window can be manually maximized by the user.
479487
///
480-
/// @platforms windows
488+
/// @platforms macos,windows
481489
Future<bool> isMaximizable() async {
482490
return await _channel.invokeMethod('isMaximizable');
483491
}

0 commit comments

Comments
 (0)