HeaderDialog class

A dialog with a colored header bar and close button outside the box.

This dialog style features:

  • Close button positioned outside (top-left) the dialog
  • A colored header with title
  • Custom content area
  • Primary and optional secondary action buttons
Inheritance

Constructors

HeaderDialog({Key? key, required String headerTitle, Color? headerColor, Color? headerTextColor, required Widget child, String? primaryButtonText, String? secondaryButtonText, VoidCallback? onPrimaryPressed, VoidCallback? onSecondaryPressed, Color? primaryButtonColor, Color? secondaryButtonColor, bool showCloseButton = true, VoidCallback? onClose, bool isDark = false, double? blur, ImageFilter? backdropFilter, double? borderRadius})
Creates a header dialog.
const

Properties

backdropFilter ImageFilter?
Custom backdrop filter.
final
blur double?
Blur amount for glassmorphism effect.
final
borderRadius double?
Custom border radius for the dialog.
final
child Widget
The main content of the dialog.
final
hashCode int
The hash code for this object.
no setterinherited
headerColor Color?
The background color of the header bar. Defaults to primary color from theme.
final
headerTextColor Color?
The text color for the header title. Defaults to white.
final
headerTitle String
The title displayed in the header bar.
final
isDark bool
Whether to use dark mode colors.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onClose VoidCallback?
Callback when close button is pressed. If null, defaults to popping the dialog.
final
onPrimaryPressed VoidCallback?
Callback when primary button is pressed.
final
onSecondaryPressed VoidCallback?
Callback when secondary button is pressed.
final
primaryButtonColor Color?
Color for the primary button.
final
primaryButtonText String?
Text for the primary action button.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryButtonColor Color?
Color for the secondary button border and text.
final
secondaryButtonText String?
Text for the secondary (outlined) action button.
final
showCloseButton bool
Whether to show the close button outside the dialog.
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