StacAlertDialog class
A Stac model representing Flutter's AlertDialog
widget.
A Material Design dialog that informs the user about situations that require acknowledgement. Includes optional title, content, and action buttons.
{@tool snippet} Dart Example:
const StacAlertDialog(
title: StacText(data: 'Confirm'),
content: StacText(data: 'Proceed with action?'),
actions: [
StacTextButton(child: StacText(data: 'Cancel')),
StacTextButton(child: StacText(data: 'OK')),
],
)
{@end-tool}
{@tool snippet} JSON Example:
{
"type": "alertDialog",
"title": {"type": "text", "data": "Confirm"},
"content": {"type": "text", "data": "Proceed with action?"},
"actions": [
{"type": "textButton", "child": {"type": "text", "data": "Cancel"}},
{"type": "textButton", "child": {"type": "text", "data": "OK"}}
]
}
{@end-tool}
See also:
- Flutter's AlertDialog documentation
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacAlertDialog
- Annotations
-
- @JsonSerializable()
Constructors
-
StacAlertDialog.new({StacWidget? icon, StacEdgeInsets? iconPadding, StacColor? iconColor, StacWidget? title, StacEdgeInsets? titlePadding, StacTextStyle? titleTextStyle, StacWidget? content, StacEdgeInsets? contentPadding, StacTextStyle? contentTextStyle, List<
StacWidget> ? actions, StacEdgeInsets? actionsPadding, StacMainAxisAlignment? actionsAlignment, StacOverflowBarAlignment? actionsOverflowAlignment, StacVerticalDirection? actionsOverflowDirection, double? actionsOverflowButtonSpacing, StacEdgeInsets? buttonPadding, StacColor? backgroundColor, double? elevation, StacColor? shadowColor, StacColor? surfaceTintColor, String? semanticLabel, StacEdgeInsets? insetPadding = const StacEdgeInsets(left: 40, right: 40, top: 24, bottom: 24), StacClip? clipBehavior, StacShapeBorder? shape, StacAlignment? alignment, bool? scrollable}) -
Creates a StacAlertDialog with the given properties.
const
-
StacAlertDialog.fromJson(Map<
String, dynamic> json) -
Creates a StacAlertDialog from a JSON map.
factory
Properties
-
actions
→ List<
StacWidget> ? -
Dialog action buttons.
final
- actionsAlignment → StacMainAxisAlignment?
-
How the actions should be placed along the main axis.
final
- actionsOverflowAlignment → StacOverflowBarAlignment?
-
How overflowing actions should be aligned horizontally.
final
- actionsOverflowButtonSpacing → double?
-
Spacing between overflowing action buttons.
final
- actionsOverflowDirection → StacVerticalDirection?
-
The vertical direction for overflowing actions.
final
- actionsPadding → StacEdgeInsets?
-
Padding around actions.
final
- alignment → StacAlignment?
-
Where to align the dialog.
final
- backgroundColor → StacColor?
-
The background color of the dialog's surface.
final
-
The padding for the button bar.
final
- clipBehavior → StacClip?
-
How to clip the content.
final
- content → StacWidget?
-
The primary content of the dialog.
final
- contentPadding → StacEdgeInsets?
-
Padding around content.
final
- contentTextStyle → StacTextStyle?
-
Text style for content.
final
- elevation → double?
-
The z-coordinate at which to place this dialog.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → StacWidget?
-
Optional icon widget displayed above the title.
final
- iconColor → StacColor?
-
Color for the icon.
final
- iconPadding → StacEdgeInsets?
-
Padding around icon.
final
- insetPadding → StacEdgeInsets?
-
The padding around the outside of the dialog.
final
-
jsonData
→ Map<
String, dynamic> ? -
Raw JSON data for this widget
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollable → bool?
-
Whether the dialog is scrollable.
final
- semanticLabel → String?
-
The semantic label of the dialog.
final
- shadowColor → StacColor?
-
The color of the dialog's shadow.
final
- shape → StacShapeBorder?
-
The shape of the dialog's material.
final
- surfaceTintColor → StacColor?
-
The color of the surface tint overlay applied to the background.
final
- title → StacWidget?
-
The title of the dialog.
final
- titlePadding → StacEdgeInsets?
-
Padding around title.
final
- titleTextStyle → StacTextStyle?
-
Text style for title.
final
- type → String
-
Widget type identifier.
no setteroverride
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this StacAlertDialog instance to a JSON map.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited