ExtendedAlertDialog class
A customizable AlertDialog with optional title, message, and action buttons. Supports styling and centering text, as well as custom colors for confirm/cancel buttons.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ExtendedAlertDialog
- Available extensions
Constructors
- ExtendedAlertDialog({Key? key, String? title, required String message, String? confirmText, String? cancelText, VoidCallback? onConfirm, VoidCallback? onCancel, bool? center, Color? confirmColor, Color? cancelColor, TextStyle? titleStyle, TextStyle? messageStyle, TextStyle? confirmStyle, TextStyle? cancelStyle})
-
const
Properties
- cancelColor → Color?
-
Color of the cancel button.
final
- cancelStyle → TextStyle?
-
Optional style for the cancel button text.
final
- cancelText → String?
-
Text for the cancel button (default: "Cancel").
final
- center → bool?
-
If true, text content and title are centered.
final
- confirmColor → Color?
-
Color of the confirm button.
final
- confirmStyle → TextStyle?
-
Optional style for the confirm button text.
final
- confirmText → String?
-
Text for the confirm button (default: "Confirm").
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- message → String
-
The main message body of the dialog.
final
- messageStyle → TextStyle?
-
Optional style for the message text.
final
- onCancel → VoidCallback?
-
Callback executed when the cancel button is tapped.
final
- onConfirm → VoidCallback?
-
Callback executed when the confirm button is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String?
-
Optional title of the dialog.
final
- titleStyle → TextStyle?
-
Optional style for the title text.
final
Methods
-
action(
String text, {BuildContext? context, TextStyle? style, Color? color, void onTap()?}) → Expanded -
Builds a single action button (confirm or cancel) with optional
style,color, andonTapcallback. -
align(
Alignment alignment) → Widget -
Available on Widget, provided by the ExtWidget extension
Aligns this widget with the givenalignment. -
aspectRatio(
double ratio) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in an AspectRatio with the givenratio. -
blurred(
double sigmaX, double sigmaY, [Duration duration = const Duration(milliseconds: 300)]) → Widget -
Available on Widget, provided by the ExtWidget extension
Applies a blur effect to this widget with the givensigmaXandsigmaY. -
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
center(
) → Widget - Centers this widget.
-
clipped(
{BorderRadius? borderRadius}) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a ClipRRect with the givenborderRadius. IfborderRadiusis not provided, a circular radius of 8.0 is used. Example: -
container(
{Color? color, DecorationImage? image, BoxBorder? border, BorderRadiusGeometry? borderRadius, List< BoxShadow> ? boxShadow, Gradient? gradient, BlendMode? backgroundBlendMode, BoxShape shape = BoxShape.rectangle, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, double? width, double? height, BoxConstraints? constraints, AlignmentGeometry? alignment}) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a Container with the given decoration parameters. -
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
-
expanded(
{int flex = 1}) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget with Expanded with optionalflex. -
faded(
double opacity, [Duration duration = const Duration(milliseconds: 300)]) → Widget -
Available on Widget, provided by the ExtWidget extension
Fades this widget to the givenopacity. Animate if opacity changes. -
fadedIn(
[Duration duration = const Duration(milliseconds: 300)]) → Widget -
Available on Widget, provided by the ExtWidget extension
Fades this widget in with the givenduration. -
fadedOut(
[Duration duration = const Duration(milliseconds: 300)]) → Widget -
Available on Widget, provided by the ExtWidget extension
Fades this widget out with the givenduration. -
flexible(
{int flex = 1, FlexFit fit = FlexFit.loose}) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget with Flexible with optionalflexandfit. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
offstage(
bool isOffstage) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget with Offstage based onisOffstage. -
onLongPress(
VoidCallback callback) → Widget -
Available on Widget, provided by the ExtWidget extension
Adds an onLongPress gesture using InkWell over a transparent Material. -
onTap(
VoidCallback callback) → Widget -
Available on Widget, provided by the ExtWidget extension
Adds an onTap gesture using InkWell over a transparent Material. -
positioned(
{double? left, double? top, double? right, double? bottom}) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a Positioned with the given parameters. -
positionedFill(
{double? left, double? top, double? right, double? bottom}) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a Positioned.fill with the given parameters. -
rotated(
double degree, [Duration duration = const Duration(milliseconds: 300)]) → Widget -
Available on Widget, provided by the ExtWidget extension
Rotates this widget bydegreedegrees. Animate if degree changes. -
safe(
) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a SafeArea. -
scaled(
double scale, [Duration duration = const Duration(milliseconds: 300)]) → Widget -
Available on Widget, provided by the ExtWidget extension
Scales this widget byscale. Animate if scale changes. -
sized(
{double? width, double? height}) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a SizedBox with the givenwidthand/orheight. -
sizedSquare(
double size) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a square SizedBox with both width and height set tosize. -
sliver(
) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a SliverToBoxAdapter, useful for slivers in CustomScrollView. -
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
-
translated(
double x, double y, [Duration duration = const Duration(milliseconds: 300)]) → Widget -
Available on Widget, provided by the ExtWidget extension
Translates this widget byoffset. Animate if offset changes. -
visibility(
bool isVisible) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget with Visibility based onisVisible. -
visibilityAnimated(
bool isVisible, [Duration duration = const Duration(milliseconds: 300)]) → Widget -
Available on Widget, provided by the ExtWidget extension
Animates the visibility of this widget based onisVisible. -
withPadding(
{double? all, double? horizontal, double? vertical, double? top, double? bottom, double? left, double? right}) → Widget -
Available on Widget, provided by the ExtWidget extension
Wraps this widget in a Padding with the given values. Ifallis provided, it overrides other parameters. Example:
Operators
-
operator *(
int n) → List< Widget> -
Available on Widget, provided by the ExtWidget extension
Creates a list containingncopies of this widget. -
operator ==(
Object other) → bool -
The equality operator.
inherited