ElegantAlertDialog class
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ElegantAlertDialog
Constructors
-
ElegantAlertDialog.new({Key? key, required ElegantBodyWidget alertContent, Color backgroundColor = Colors.white, Color? borderColor = Colors.blue, List<
Widget> actions = const [], List<BoxShadow> ? dialogShadow, AnimationTypes animationType = AnimationTypes.scaleAnimation, Curve animationCurve = Curves.ease, Duration animationDuration = const Duration(seconds: 1), bool barrierDismissable = true, double height = 150, double borderRadius = 10, double borderSize = 1, bool withAnimation = true}) -
ElegantAlertDialog.caution({Key? key, required ElegantBodyWidget alertContent, required String? confirmButtonText, required String? cancelButtonText, dynamic onConfirmButtonPressed()?, dynamic onCancelPressed()?, Color? confirmButtonColor = Colors.blue, Color? cancelButtonColor = Colors.grey, AnimationTypes animationType = AnimationTypes.scaleAnimation, Curve animationCurve = Curves.ease, Duration animationDuration = const Duration(seconds: 1), Color backgroundColor = Colors.white, List<
BoxShadow> ? dialogShadow, bool barrierDismissable = true, double height = 150, double borderRadius = 10, double borderSize = 1, bool withAnimation = true}) -
ElegantAlertDialog.info({Key? key, required ElegantBodyWidget alertContent, required String? confirmButtonText, Color? confirmButtonColor = Colors.blue, dynamic onConfirmButtonPressed()?, AnimationTypes animationType = AnimationTypes.scaleAnimation, Curve animationCurve = Curves.ease, Duration animationDuration = const Duration(seconds: 1), Color backgroundColor = Colors.white, List<
BoxShadow> ? dialogShadow, bool barrierDismissable = true, double height = 150, double borderRadius = 10, double borderSize = 1, bool withAnimation = true}) -
ElegantAlertDialog.multiActions({Key? key, required ElegantBodyWidget alertContent, required String? confirmButtonText, required String? secondButtonText, required String? cancelButtonText, Color? confirmButtonColor = Colors.blue, Color? secondButtonColor = Colors.grey, Color? cancelButtonColor = Colors.green, dynamic onConfirmButtonPressed()?, dynamic onSecondaryButtonPressed()?, dynamic onCancelPressed()?, AnimationTypes animationType = AnimationTypes.scaleAnimation, Curve animationCurve = Curves.ease, Duration animationDuration = const Duration(seconds: 1), Color backgroundColor = Colors.white, List<
BoxShadow> ? dialogShadow, bool barrierDismissable = true, double height = 150, double borderRadius = 10, double borderSize = 1, bool withAnimation = true}) -
ElegantAlertDialog.permission({Key? key, required ElegantBodyWidget alertContent, required String? confirmButtonText, required String? cancelButtonText, dynamic onConfirmButtonPressed()?, dynamic onCancelPressed()?, Color? confirmButtonColor = Colors.blue, Color? cancelButtonColor = Colors.grey, AnimationTypes animationType = AnimationTypes.scaleAnimation, Curve animationCurve = Curves.ease, Duration animationDuration = const Duration(seconds: 1), Color backgroundColor = Colors.white, List<
BoxShadow> ? dialogShadow, bool barrierDismissable = true, double height = 150, double borderRadius = 10, double borderSize = 1, bool withAnimation = true})
Properties
-
actions
↔ List<
Widget> -
the list of actions (widgets) that will be rendered as buttons
required when using
custom
constructorgetter/setter pair - alertContent → ElegantBodyWidget
-
Alert content widget, it's required in all constructors
ElegantBodyWidget contain two attributes
title
anddescription
of type widgets both are requiredfinal - animationCurve → Curve
-
the animation curve used to render the animation
by default its Curves.ease
final
- animationDuration → Duration
-
The animation duration of being rendered
the default duration is set to one second
final
- animationType → AnimationTypes
-
the type of animation rendered
AnimationTypes.slideAnimation to render a scale animation using SlideTransition
AnimationTypes.scaleAnimation to show an animation using Transform.scale
final
- backgroundColor → Color
-
The alert dialog background color, by default alert is white
it's used to render the alert content widget
final
- barrierDismissable → bool
-
indicate whether the barrier is dismissable or not
by default {barrierDismissable == true}
final
- borderColor ↔ Color?
-
The alert border color
getter/setter pair
- borderRadius → double
-
the alert dialog border radius
final
- borderSize → double
-
the alert dialog border size
final
- cancelButtonColor ↔ Color?
-
The cancel button color
multiActions and caution constructors the cancel button
permission the deny button text
getter/setter pair
- cancelButtonText ↔ String?
-
The cancel button text
multiActions the cancel button text
permission the deny button text
caution the cancel button text
getter/setter pair
- confirmButtonColor ↔ Color?
-
The main button color
multiActions constructor is the primary button
permission constructor is the allowButton
caution constructor is the delete button
info constructor is the confirmation button
getter/setter pair
- confirmButtonText ↔ String?
-
The main button text
multiActions constructor is the primaryActionButton
permission is the allowButton text
caution is the delete button text
info is the confirmation button text
getter/setter pair
-
dialogShadow
→ List<
BoxShadow> ? -
list of shadows applied to the alert dialog
by default dialogShadow is null and a default shadow is applied
final
- elegantAlertType ↔ ElegantAlertType?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
the alert dialog height
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onCancelPressed ↔ dynamic Function()?
-
The cancel button action callback
multiActions and caution constructors is the cancel button
permission the deny button
getter/setter pair
- onConfirmButtonPressed ↔ dynamic Function()?
-
The main button callback action
multiActions primary button callback action
permission the allow button action callback
caution the delete button action callback
info the confirmation button action callback
getter/setter pair
- onSecondaryButtonPressed ↔ dynamic Function()?
-
A secondary main button, displayed only when using multiActions constructor
the action callback will be called when pressing the secondary main button
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondButtonColor ↔ Color?
-
A secondary main button, displayed only when using multiActions constructor
the color in which the secondary button is rendered
getter/setter pair
- secondButtonText ↔ String?
-
A secondary main button, displayed only when using multiActions constructor
multiActions constructor is the primaryActionButton
getter/setter pair
- withAnimation → bool
-
indicate whether the animation will be displayed when showing the alert
by default
withAnimation == true
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ElegantAlertDialog> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
-
show(
BuildContext context) → void -
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