Skip to content

Commit

Permalink
feat: New flyout placement modes: leftTop, leftCenter, leftBottom, ri…
Browse files Browse the repository at this point in the history
…ghtTop, rightCenter, rightBottom
  • Loading branch information
bdlukaa committed Feb 2, 2025
1 parent 580b1e1 commit bfdf585
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 83 deletions.
18 changes: 9 additions & 9 deletions example/lib/screens/navigation/navigation_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class NavigationViewPage extends StatefulWidget {

class _NavigationViewPageState extends State<NavigationViewPage>
with PageMixin {
static const double itemHeight = 300.0;
static const double itemHeight = 500.0;

int topIndex = 0;

Expand Down Expand Up @@ -66,6 +66,7 @@ class _NavigationViewPageState extends State<NavigationViewPage>
enabled: false,
onTap: () => debugPrint('Tapped disabled'),
),
PaneItemHeader(header: const Text('Apps')),
PaneItemExpander(
icon: const Icon(FluentIcons.account_management),
title: const Text('Account'),
Expand All @@ -84,7 +85,6 @@ class _NavigationViewPageState extends State<NavigationViewPage>
),
onTap: () => debugPrint('Tapped account'),
items: [
PaneItemHeader(header: const Text('Apps')),
PaneItem(
icon: const Icon(FluentIcons.mail),
title: const Text('Mail'),
Expand Down Expand Up @@ -376,13 +376,13 @@ NavigationView(
selected: topIndex,
onItemPressed: (index) {
// Do anything you want to do, such as:
if (index == topIndex) {
if (displayMode == PaneDisplayMode.open) {
setState(() => this.displayMode = PaneDisplayMode.compact);
} else if (displayMode == PaneDisplayMode.compact) {
setState(() => this.displayMode = PaneDisplayMode.open);
}
}
// if (index == topIndex) {
// if (displayMode == PaneDisplayMode.open) {
// setState(() => this.displayMode = PaneDisplayMode.compact);
// } else if (displayMode == PaneDisplayMode.compact) {
// setState(() => this.displayMode = PaneDisplayMode.open);
// }
// }
},
onChanged: (index) => setState(() => topIndex = index),
displayMode: displayMode,
Expand Down
10 changes: 7 additions & 3 deletions example/lib/screens/popups/teaching_tip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ class _TeachingTipPageState extends State<TeachingTipPage> with PageMixin {
'Bottom left': FlyoutPlacementMode.bottomLeft,
'Bottom center': FlyoutPlacementMode.bottomCenter,
'Bottom right': FlyoutPlacementMode.bottomRight,
'Center': FlyoutPlacementMode.left,
'Center': FlyoutPlacementMode.leftCenter,
'Top left': FlyoutPlacementMode.topLeft,
'Top center': FlyoutPlacementMode.topCenter,
'Top right': FlyoutPlacementMode.topRight,
'Right': FlyoutPlacementMode.right,
'Left': FlyoutPlacementMode.left,
'Right Top': FlyoutPlacementMode.rightTop,
'Right Center': FlyoutPlacementMode.rightCenter,
'Right Bottom': FlyoutPlacementMode.rightBottom,
'Left Top': FlyoutPlacementMode.leftTop,
'Left Center': FlyoutPlacementMode.leftCenter,
'Left Bottom': FlyoutPlacementMode.leftBottom,
};
var alignment = 'Bottom center';
var placement = 'Bottom center';
Expand Down
Loading

0 comments on commit bfdf585

Please sign in to comment.