NavPages class
A widget that manages multiple pages with integrated navigation controls.
NavPages provides a complete solution for managing multiple pages with built-in navigation controls and responsive design. It automatically adapts to different screen sizes and provides Navigator-like methods for controlling page history.
Example:
NavPages(
buttons: [
NavRailButton(label: 'Home', icon: Icons.home),
NavRailButton(label: 'Settings', icon: Icons.settings),
],
children: [
NavPage(navbar: Navbar(title: 'Home'), child: HomePage()),
NavPage(navbar: Navbar(title: 'Settings'), child: SettingsPage()),
],
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- NavPages
Constructors
-
Creates a NavPages widget.
const
Properties
-
actions
→ List<
NrButtonWidget> -
Additional action buttons for the navigation rail.
final
-
The navigation buttons for the rail.
final
-
children
→ List<
Widget> -
The list of pages to display.
final
- direction → NavPagesDirection
-
The direction in which the navigation is laid out.
final
- expandable → bool
-
Whether the navigation rail can be expanded/collapsed.
final
- expandableButtonHeight → double
-
The height of the expandable button.
final
- expanded → bool
-
The initial expanded state of the navigation rail.
final
-
The footer widget for the site.
final
- fullscreen → bool
-
Whether to use the full screen.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
The header widget for the site.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
The leading widget for the navigation rail.
final
-
Whether the leading widget is on the top is true.
final
-
The maximum height of the navigation rail.
final
-
The maximum width of the navigation rail.
final
-
The minimum height of the navigation rail.
final
-
The minimum width of the navigation rail.
final
-
The position of the navigation rail.
final
-
The small leading widget for the navigation rail.
final
-
Whether the navigation rail can be scrolled vertically.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showActionSelectedIndex → bool
-
Whether to show the selected action index.
final
- showSecondaryActionSelectedIndex → bool
-
Whether to show the selected secondary action index.
final
-
Whether to use the full footer when direction is vertical.
final
- useFullHeader → bool
-
Whether to use the full header when direction is vertical.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< NavPages> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
canPop(
BuildContext context) → bool - Returns whether the navigation stack can be popped.
-
of(
BuildContext context) → NavPagesState - Returns the NavPagesState associated with the nearest NavPages widget.
-
pop(
BuildContext context) → void - Pops the current page from the navigation stack.
-
push(
BuildContext context, Widget page) → void - Pushes a new page onto the navigation stack.
-
pushReplacement(
BuildContext context, Widget page) → void - Replaces the current page with a new page.