DialogTheme class

Defines a theme for Dialog widgets.

Descendant widgets obtain the current DialogTheme object using DialogTheme.of(context). Instances of DialogTheme can be customized with DialogTheme.copyWith.

titleTextStyle and contentTextStyle are used in AlertDialogs and SimpleDialogs.

See also:

Mixed in types
Annotations

Constructors

DialogTheme({Color? backgroundColor, double? elevation, Color? shadowColor, Color? surfaceTintColor, ShapeBorder? shape, AlignmentGeometry? alignment, Color? iconColor, TextStyle? titleTextStyle, TextStyle? contentTextStyle, EdgeInsetsGeometry? actionsPadding, Color? barrierColor, EdgeInsets? insetPadding, Clip? clipBehavior})
Creates a dialog theme that can be used for ThemeData.dialogTheme.
const

Properties

actionsPadding EdgeInsetsGeometry?
Overrides the default value for AlertDialog.actionsPadding.
final
alignment AlignmentGeometry?
Overrides the default value for Dialog.alignment.
final
backgroundColor Color?
Overrides the default value for Dialog.backgroundColor.
final
barrierColor Color?
Overrides the default value for barrierColor in showDialog.
final
clipBehavior Clip?
Overrides the default value of Dialog.clipBehavior.
final
contentTextStyle TextStyle?
Overrides the default value for DefaultTextStyle for SimpleDialog.children and AlertDialog.content.
final
elevation double?
Overrides the default value for Dialog.elevation.
final
hashCode int
The hash code for this object.
no setteroverride
iconColor Color?
Used to configure the IconTheme for the AlertDialog.icon widget.
final
insetPadding EdgeInsets?
Overrides the default value for Dialog.insetPadding.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowColor Color?
Overrides the default value for Dialog.shadowColor.
final
shape ShapeBorder?
Overrides the default value for Dialog.shape.
final
surfaceTintColor Color?
Overrides the default value for Dialog.surfaceTintColor.
final
titleTextStyle TextStyle?
Overrides the default value for DefaultTextStyle for SimpleDialog.title and AlertDialog.title.
final

Methods

copyWith({Color? backgroundColor, double? elevation, Color? shadowColor, Color? surfaceTintColor, ShapeBorder? shape, AlignmentGeometry? alignment, Color? iconColor, TextStyle? titleTextStyle, TextStyle? contentTextStyle, EdgeInsetsGeometry? actionsPadding, Color? barrierColor, EdgeInsets? insetPadding, Clip? clipBehavior}) DialogTheme
Creates a copy of this object but with the given fields replaced with the new values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
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
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

lerp(DialogTheme? a, DialogTheme? b, double t) DialogTheme
Linearly interpolate between two dialog themes.
of(BuildContext context) DialogTheme
The data from the closest DialogTheme instance given the build context.