Skip to content
New issue

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

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

Already on GitHub? # to your account

Either pane or content must be provided🐛 #871

Closed
StevenHX opened this issue Jun 29, 2023 · 1 comment
Closed

Either pane or content must be provided🐛 #871

StevenHX opened this issue Jun 29, 2023 · 1 comment

Comments

@StevenHX
Copy link

Either pane or content must be provided
'package:fluent_ui/src/controls/navigation/navigation_view/view.dart':
Failed assertion: line 55 pos 11: '(pane != null && content == null) ||
(pane == null && content != null)'

but i have already set the navigation pane, like this:

NavigationView (
content: const Text("111111"),
pane: NavigationPane(
selected: index,
onChanged: (i) => setState(() => index = i),
displayMode: PaneDisplayMode.open,
size: const NavigationPaneSize(
openWidth: 150,
),
header: const Text("1111"),
items: [
PaneItem(
icon: const Icon(FluentIcons.icon_sets_flag),
title: const Text("首页"),
body: const Text("11")),
PaneItemSeparator(),
PaneItem(
icon: const Icon(FluentIcons.e_discovery),
title: const Text("新闻"),
body: const Text("11")),
]),
)

@StevenHX
Copy link
Author

BREAKING Removed NavigationBody. Use PaneItem.body instead (#510/#531):
Before:

NavigationView(
pane: NavigationPane(
items: [
PaneItem(icon: Icon(FluentIcons.add)),
PaneItem(icon: Icon(FluentIcons.add)),
PaneItem(icon: Icon(FluentIcons.add)),
],
),
content: NavigationBody(
children: [
_Item1(),
_Item2(),
_Item3(),
],
),
),
Now:

NavigationView(
...
pane: NavigationPane(
items: [
PaneItem(
icon: Icon(FluentIcons.add),
body: _Item1(),
),
PaneItem(
icon: Icon(FluentIcons.add),
body: _Item2(),
),
PaneItem(
icon: Icon(FluentIcons.add),
body: _Item3(),
),
],
),
),
Or if you don't have a pane, you can use the content like the following:

NavigationView(
content: ScaffoldPage(
header: PageHeader(
title: titleRow,
),
content: child,
),
),
either one attribute of pane or content must not be null

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

No branches or pull requests

1 participant