Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with navigation #146

Closed
harilet opened this issue Jan 28, 2022 · 6 comments
Closed

Help with navigation #146

harilet opened this issue Jan 28, 2022 · 6 comments

Comments

@harilet
Copy link

harilet commented Jan 28, 2022

How do I set default to expand in compact?
image

And prevent auto collapsing?

image

@jonahzheng
Copy link

    final appTheme = context.watch<AppTheme>();
    appTheme.displayMode = PaneDisplayMode.compact;

@harilet
Copy link
Author

harilet commented Jan 28, 2022

Is there AppTheme inside fluent_ui or do I have to implement??

@jonahzheng
Copy link

https://github.com/bdlukaa/fluent_ui/blob/master/example/lib/theme.dart

or set
NavigationPane(
displayMode: PaneDisplayMode.compact
)

@harilet
Copy link
Author

harilet commented Jan 28, 2022

That is what I did, but the navigation does not keep expanded to always collapsed
image
Clicked it expanded

image
Go to another view automatically collapsed back

@bdlukaa
Copy link
Owner

bdlukaa commented Jan 28, 2022

It's the default platform behavior. When in compact mode, the user can press the button to open it. If the screen is too small, it's still opened as an overlay. You can see this behavior on multiple native windows apps, and on XAML Gallery, in which this library is based on.

To disable the button, use the menuButton property in NavigationPane:

NavigationPane(
  ...,
  menuButton: const SizedBox.shrink(),
  ...,
);

@harilet
Copy link
Author

harilet commented Jan 31, 2022

Ok thanks, I got it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants