AppDashboardShell class

Adaptive app shell: a collapsible side rail (desktop / tablet) plus an optional bottom nav (mobile), wrapping a routed child. Presentational only — it knows nothing about permissions, providers or routing. Callers pass the already-filtered items / mobileNavItems, the currentRoute, and the onNavigate / onLogout callbacks.

The side menu is a custom, shadcn-style rail (no external package): rounded hover/active tiles, collapsible groups with an indented guide line, and an icon-only collapsed mode whose groups open as a flyout popup. It composes the smaller AppSidebar / sidebar widgets in this package; reuse those directly to build a different chrome.

Inheritance

Constructors

AppDashboardShell({Key? key, required Widget child, required List<NavItem> items, required String currentRoute, required void onNavigate(String route), required VoidCallback onLogout, List<NavAction> mobileNavItems = const [], String appTitle = 'Dashboard', TextStyle? titleStyle, String logoutLabel = 'Logout', DashboardBreakpoints breakpoints = const DashboardBreakpoints(), String? userName, String? userEmail, Widget? userAvatar, VoidCallback? onProfileTap})
const

Properties

appTitle String
Brand text shown in the expanded header.
final
breakpoints DashboardBreakpoints
Width thresholds that decide the layout.
final
child Widget
Routed content rendered beside / below the navigation.
final
currentRoute String
Current location (e.g. GoRouterState.of(context).uri.toString()).
final
hashCode int
The hash code for this object.
no setterinherited
items List<NavItem>
Side-menu entries, in display order (filter for permissions before passing them in).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
Optional brand mark shown in the header before appTitle.
final
logoutLabel String
Label for the footer logout entry.
final
mobileNavItems List<NavAction>
Mobile bottom-nav entries. Empty => no bottom nav.
final
onLogout VoidCallback
Called when the user taps the logout entry.
final
onNavigate → void Function(String route)
Called with the destination route when the user taps a nav entry.
final
onProfileTap VoidCallback?
Tapped when the profile row is pressed (e.g. open account / settings).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
titleStyle TextStyle?
Overrides the resolved appTitle text style.
final
userAvatar Widget?
Optional custom avatar widget. Falls back to initials of userName.
final
userEmail String?
Signed-in user's email / secondary line, shown under userName.
final
userName String?
Signed-in user's display name. When null/empty the footer shows only the logout entry (no profile row).
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AppDashboardShell>
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