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

Create PaneItemWidget #1087

Closed
md-rifatkhan opened this issue Jul 17, 2024 · 1 comment
Closed

Create PaneItemWidget #1087

md-rifatkhan opened this issue Jul 17, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@md-rifatkhan
Copy link

Custom Navigation Pane Widget
It will better to support custom navigation pane widget.

Because sometime we need to add slider or custom button on navigation view

@bdlukaa
Copy link
Owner

bdlukaa commented Jul 18, 2024

You can create a PaneItem, just as you would create a widget.

class _LinkPaneItemAction extends PaneItem {
_LinkPaneItemAction({
required super.icon,
required this.link,
required super.body,
super.title,
});
final String link;
@override
Widget build(
BuildContext context,
bool selected,
VoidCallback? onPressed, {
PaneDisplayMode? displayMode,
bool showTextOnTop = true,
bool? autofocus,
int? itemIndex,
}) {
return Link(
uri: Uri.parse(link),
builder: (context, followLink) => Semantics(
link: true,
child: super.build(
context,
selected,
followLink,
displayMode: displayMode,
showTextOnTop: showTextOnTop,
itemIndex: itemIndex,
autofocus: autofocus,
),
),
);
}
}

Note that it behaves as a pane item, and it has an index.

The creation of a PaneItemWidget would be a good addition.

@bdlukaa bdlukaa changed the title Add custom widget support to NavigationPane, Create PaneItemWidget Jul 18, 2024
@bdlukaa bdlukaa added the enhancement New feature or request label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants