TAdminHeader class

A flexible and customizable header widget for use across various screens.

  • scaffoldKey is required for managing the drawer on mobile.
Inheritance
Implemented types

Constructors

TAdminHeader({Key? key, required GlobalKey<ScaffoldState> scaffoldKey, Widget? title, IconData? leadingIcon, VoidCallback? leadingOnPressed, List<Widget> actions = const [], String? profileImage, ImageType? imageType, String? profileName, String? profileEmail, void profileOnTap()?, bool showSearch = true, bool showMenu = true, bool loading = false, String searchHint = 'Search anything...', bool showOrderIcon = true, bool showNotificationIcon = true, bool showSettingsIcon = true, VoidCallback? onOrderPressed, VoidCallback? onNotificationPressed, VoidCallback? onSettingsPressed, Color? leadingIconColor})
const

Properties

actions → List<Widget>
Custom actions for the header, such as icons/buttons.
final
hashCode → int
The hash code for this object.
no setterinherited
imageType → ImageType?
Profile image URL (optional) to display in the header.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leadingIcon → IconData?
Custom leading icon and its onPressed callback.
final
leadingIconColor → Color?
final
leadingOnPressed → VoidCallback?
final
loading → bool
Flag to enable or disable the loader.
final
onNotificationPressed → VoidCallback?
final
onOrderPressed → VoidCallback?
Optional callbacks for the icons' onPressed actions
final
onSettingsPressed → VoidCallback?
final
preferredSize → Size
The size this widget would prefer if it were otherwise unconstrained.
no setteroverride
profileEmail → String?
Profile email (optional) to display in the header.
final
profileImage → String?
Profile image URL (optional) to display in the header.
final
profileName → String?
Profile name (optional) to display in the header.
final
profileOnTap → VoidCallback?
Route to navigate to when the profile is tapped.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scaffoldKey → GlobalKey<ScaffoldState>
GlobalKey to access the Scaffold state for mobile drawer management.
final
searchHint → String
Hint text for the search bar.
final
showMenu → bool
Flag to enable or disable the menu button on mobile.
final
showNotificationIcon → bool
final
showOrderIcon → bool
Flags to show or hide specific icons in the header
final
showSearch → bool
Flag to enable or disable the search bar.
final
showSettingsIcon → bool
final
title → Widget?
Customizable title widget (e.g., a Text widget or custom widget).
final

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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