ElegantNotification class
Constructors
-
ElegantNotification({Key? key, Widget? title, required Widget description, required Widget? icon, Color background = Colors.white, BorderRadius? borderRadius, BoxBorder? border, bool showProgressIndicator = true, Widget closeButton(void dismissNotification())?, StackedOptions? stackedOptions, double notificationMargin = 20, Color progressIndicatorColor = Colors.blue, Duration toastDuration = const Duration(milliseconds: 3000), bool displayCloseButton = true, void onCloseButtonPressed()?, void onProgressFinished()?, Alignment position = Alignment.topRight, AnimationType animation = AnimationType.fromRight, Duration animationDuration = const Duration(milliseconds: 600), double iconSize = defaultIconSize, Widget? action, bool autoDismiss = true, double? height, double? width, double? progressBarHeight, double? progressBarWidth, EdgeInsetsGeometry? progressBarPadding, dynamic onDismiss()?, bool isDismissable = true, DismissDirection dismissDirection = DismissDirection.horizontal, Color progressIndicatorBackground = greyColor, void onNotificationPressed()?, Curve animationCurve = Curves.ease, BoxShadow? shadow})
-
-
ElegantNotification.error({Key? key, Widget? title, required Widget description, Color background = Colors.white, Widget closeButton(void dismissNotification())?, StackedOptions? stackedOptions, double notificationMargin = 20, Duration toastDuration = const Duration(milliseconds: 3000), bool displayCloseButton = true, void onCloseButtonPressed()?, void onProgressFinished()?, double iconSize = defaultIconSize, Alignment position = Alignment.topRight, AnimationType animation = AnimationType.fromRight, Duration animationDuration = const Duration(milliseconds: 600), bool showProgressIndicator = true, Widget? action, bool autoDismiss = true, double? height, double? width, double? progressBarHeight, double? progressBarWidth, EdgeInsetsGeometry? progressBarPadding, dynamic onDismiss()?, bool isDismissable = true, DismissDirection dismissDirection = DismissDirection.horizontal, Color progressIndicatorBackground = greyColor, void onNotificationPressed()?, Curve animationCurve = Curves.ease, BoxShadow? shadow, BorderRadius? borderRadius, BoxBorder? border})
-
-
ElegantNotification.info({Key? key, Widget? title, required Widget description, Color background = Colors.white, Widget closeButton(void dismissNotification())?, StackedOptions? stackedOptions, double notificationMargin = 20, Duration toastDuration = const Duration(milliseconds: 3000), bool displayCloseButton = true, void onCloseButtonPressed()?, void onProgressFinished()?, double iconSize = defaultIconSize, Alignment position = Alignment.topRight, AnimationType animation = AnimationType.fromRight, Duration animationDuration = const Duration(milliseconds: 600), bool showProgressIndicator = true, Widget? action, bool autoDismiss = true, double? height, double? width, double? progressBarHeight, double? progressBarWidth, EdgeInsetsGeometry? progressBarPadding, dynamic onDismiss()?, bool isDismissable = true, DismissDirection dismissDirection = DismissDirection.horizontal, Color progressIndicatorBackground = greyColor, void onNotificationPressed()?, Curve animationCurve = Curves.ease, BoxShadow? shadow, BorderRadius? borderRadius, BoxBorder? border})
-
-
ElegantNotification.success({Key? key, Widget? title, required Widget description, Color background = Colors.white, Widget closeButton(void dismissNotification())?, StackedOptions? stackedOptions, double notificationMargin = 20, Duration toastDuration = const Duration(milliseconds: 3000), bool displayCloseButton = true, void onCloseButtonPressed()?, void onProgressFinished()?, double iconSize = defaultIconSize, Alignment position = Alignment.topRight, AnimationType animation = AnimationType.fromRight, Duration animationDuration = const Duration(milliseconds: 600), bool showProgressIndicator = true, Widget? action, bool autoDismiss = true, double? height, double? width, double? progressBarHeight, double? progressBarWidth, EdgeInsetsGeometry? progressBarPadding, dynamic onDismiss()?, bool isDismissable = true, DismissDirection dismissDirection = DismissDirection.horizontal, Color progressIndicatorBackground = greyColor, void onNotificationPressed()?, Curve animationCurve = Curves.ease, BoxShadow? shadow, BorderRadius? borderRadius, BoxBorder? border})
-
Properties
-
action
→ Widget?
-
a secondary widget displayed under the description widget
by default
action == null
final
-
animation
→ AnimationType
-
The type of the animation set on the notification
possible values
final
-
animationCurve
→ Curve
-
final
-
animationDuration
→ Duration
-
The duration of the animation
Default value
Duration(milliseconds: 600)
final
-
autoDismiss
→ bool
-
define whether the notification will be dismissed automatically or not
by default
autoDimiss == false
final
-
background
↔ Color
-
the background color of the notification
by default it's set to white
for types constructors (Success, Info, Delete) this parameter is unchangeable
getter/setter pair
-
border
→ BoxBorder?
-
The notification widget border
final
-
borderRadius
→ BorderRadius?
-
the border radius of the notification widget
final
-
closeButton
→ (Widget Function(void dismissNotification())?)
-
Close widget rendered as the close function
by default the close button is displayed, if you don't want it set
closeButton
to null
for types constructors (Success, Info, Delete) this parameter is unchangeable
final
-
description
→ Widget
-
The toast description widget
final
-
dismissDirection
→ DismissDirection
-
The direction of the dismissible widget
by default it's
DismissDirection.horizontal
final
-
displayCloseButton
→ bool
-
Display or hide the close button
by default the close button is displayed
for types constructors (Success, Info, Delete) this parameter is unchangeable
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
height
→ double?
-
the height of the notification widget
final
-
icon
↔ Widget?
-
The toast icon, required only if using the default constructor
for other toast types (Success, Info, error) the icon is not changeable
getter/setter pair
-
iconSize
→ double
-
The size of the icon, by default it's 20px
final
-
internalKey
→ String
-
no setter
-
isDismissable
→ bool
-
If the notification is dismissible or not
by default it's true
final
-
key
→ Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
notificationMargin
→ double
-
The margin between the notification and the edge of the screen
final
-
onCloseButtonPressed
→ (void Function()?)
-
Function invoked when user press on the close button
final
-
onDismiss
→ (dynamic Function()?)
-
Function invoked when tapping outside the notification
Or when pressing the back button of the phone
or when tapping on the screen
final
-
onNotificationPressed
→ (void Function()?)
-
Function invoked when the user taps on the notification
final
-
onProgressFinished
→ (void Function()?)
-
Function invoked when the notification is closed after the finish of the progress indicator
final
-
overlayEntry
↔ OverlayEntry?
-
getter/setter pair
-
overlayManager
→ OverlayManager
-
final
-
position
→ Alignment
-
The notification position in the screen
by default the position is set to
Alignment.topRight
final
-
progressBarHeight
→ double?
-
progress bar indicator height, by default it's null so it takes the widget's height
final
-
progressBarPadding
→ EdgeInsetsGeometry?
-
progress bar indicator padding constraints
final
-
progressBarWidth
→ double?
-
progress bar indicator width, by default it's null so it takes the widget's width
final
-
progressIndicatorBackground
→ Color
-
The progress indicator background color
by default it's grey
final
-
progressIndicatorColor
↔ Color
-
The color of the progress
by default it's blue
for types constructors (Success, Info, Delete) this parameter is unchangeable
getter/setter pair
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
shadow
→ BoxShadow?
-
The notification shadow
final
-
showProgressIndicator
↔ bool
-
enable or disable the progress indicator rendering
by default the indicator is displayed
for types constructors (Success, Info, Delete) this parameter is unchangeable
getter/setter pair
-
stackedItemPosition
→ int
-
no setter
-
stackedOptions
→ StackedOptions?
-
The options for the stacked mode
final
-
stackOverlaysLength
→ int
-
no setter
-
title
→ Widget?
-
The toast title widget
final
-
toastDuration
→ Duration
-
How much the notification will take time,
by default the duration is
3000 milliseconds
final
-
uniqueKey
→ Key
-
final
-
width
→ double?
-
the width of the notification widget
final