AlertInfo.show constructor
AlertInfo.show({
- required BuildContext context,
- required String text,
- MessagePosition position = MessagePosition.top,
- double padding = 30.0,
- int duration = 3,
- TypeInfo typeInfo = TypeInfo.info,
- Color? backgroundColor,
- Color? textColor,
- Color? iconColor,
- Color? actionColor,
- String? action,
- Function? actionCallback,
- IconData? icon,
Display an animated Alert info
Require the context and the text to be displayed
There a four type of alert warning
, error
, success
, info
AlertInfo.show(
context: context,
text: 'Alert info demo',
);
typeInfo
: to change the type of the alert by default TypeInfo.info
- TypeInfo.info :
icon
=Icons.error_outline
,iconColor
=green
- TypeInfo.warning :
icon
=Icons.warning_amber_rounded
,iconColor
=orange
- TypeInfo.success :
icon
=Icons.check_circle_outline
,iconColor
=green
- TypeInfo.error :
icon
=Icons.help_outline
,iconColor
=red
position
: the position of the alert by default MessagePosition.top
Implementation
AlertInfo.show({
required this.context,
required this.text,
this.position = MessagePosition.top,
this.padding = 30.0,
this.duration = 3,
this.typeInfo = TypeInfo.info,
this.backgroundColor,
this.textColor,
this.iconColor,
this.actionColor,
this.action,
this.actionCallback,
this.icon,
}) {
_buildAlertInfo();
}