Skip to content

Commit

Permalink
chore: add dock / undock example
Browse files Browse the repository at this point in the history
  • Loading branch information
lijy91 committed Jul 1, 2023
1 parent 3cf4007 commit 52d35d6
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions example/lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,35 @@ class _HomePageState extends State<HomePage> with TrayListener, WindowListener {
windowManager.restore();
},
),
PreferenceListItem(
title: const Text('dock / undock'),
onTap: () async {
DockSide? isDocked = await windowManager.isDocked();
BotToast.showText(text: 'isDocked: $isDocked');
},
accessoryView: Row(
children: [
CupertinoButton(
child: const Text('LEFT'),
onPressed: () async {
windowManager.dock(side: DockSide.LEFT, width: 500);
},
),
CupertinoButton(
child: const Text('RIGHT'),
onPressed: () async {
windowManager.dock(side: DockSide.RIGHT, width: 500);
},
),
CupertinoButton(
child: const Text('UNDOCK'),
onPressed: () async {
windowManager.undock();
},
),
],
),
),
PreferenceListSwitchItem(
title: const Text('isFullScreen / setFullScreen'),
onTap: () async {
Expand Down

0 comments on commit 52d35d6

Please sign in to comment.