CustomAppBar class

A secure, customizable AppBar with input validation and safe callbacks.

Security Features:

  • Input validation for sizes, heights, and font sizes
  • Safe callback execution with error handling
  • Text sanitization to prevent overflow
  • Accessibility support with semantic labels
Inheritance
Implemented types
Implementers

Constructors

CustomAppBar({Key? key, String? title, Widget? titleWidget, double height = 60.0, bool centerTitle = true, double elevation = 0, Color? shadowColor, Color? surfaceTintColor, Widget? leading, double? leadingWidth, bool showBackButton = true, IconData backIcon = Icons.arrow_back_ios, double backIconSize = 24, Color? backIconColor, VoidCallback? onBack, bool? automaticallyImplyLeading, List<Widget>? actions, double actionsIconThemePadding = 0, Color? backgroundColor, List<Color>? gradientColors, AlignmentGeometry gradientBegin = Alignment.topLeft, AlignmentGeometry gradientEnd = Alignment.bottomRight, List<double>? gradientStops, BoxDecoration? flexibleSpaceDecoration, bool transparent = false, Color? titleColor, double titleFontSize = 20.0, FontWeight titleFontWeight = FontWeight.bold, TextStyle? titleTextStyle, PreferredSizeWidget? bottom, SystemUiOverlayStyle? systemOverlayStyle, Color? foregroundColor, bool forceMaterialTransparency = false, ScrollNotificationPredicate? notificationPredicate, Clip clipBehavior = Clip.none, bool primary = true, bool excludeHeaderSemantics = false, Widget? flexibleSpace, double toolbarOpacity = 1.0, double bottomOpacity = 1.0, double? toolbarHeight, ShapeBorder? shape, IconThemeData? iconTheme, IconThemeData? actionsIconTheme, TextStyle? toolbarTextStyle, String? semanticLabel, bool? enableSecurity})
const

Properties

actions List<Widget>?
final
actionsIconTheme IconThemeData?
final
actionsIconThemePadding double
final
automaticallyImplyLeading bool?
final
backgroundColor Color?
final
backIcon IconData
final
backIconColor Color?
final
backIconSize double
final
bottom PreferredSizeWidget?
final
bottomOpacity double
final
centerTitle bool
final
clipBehavior Clip
final
elevation double
final
enableSecurity bool?
final
excludeHeaderSemantics bool
final
flexibleSpace Widget?
final
flexibleSpaceDecoration BoxDecoration?
final
forceMaterialTransparency bool
final
foregroundColor Color?
final
gradientBegin AlignmentGeometry
final
gradientColors List<Color>?
final
gradientEnd AlignmentGeometry
final
gradientStops List<double>?
final
hashCode int
The hash code for this object.
no setterinherited
height double
final
iconTheme IconThemeData?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leading Widget?
final
leadingWidth double?
final
notificationPredicate ScrollNotificationPredicate?
final
onBack VoidCallback?
final
preferredSize Size
The size this widget would prefer if it were otherwise unconstrained.
no setteroverride
primary bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
final
shadowColor Color?
final
shape ShapeBorder?
final
showBackButton bool
final
surfaceTintColor Color?
final
systemOverlayStyle SystemUiOverlayStyle?
final
title String?
final
titleColor Color?
final
titleFontSize double
final
titleFontWeight FontWeight
final
titleTextStyle TextStyle?
final
titleWidget Widget?
final
toolbarHeight double?
final
toolbarOpacity double
final
toolbarTextStyle TextStyle?
final
transparent bool
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