AlertInfo.show constructor

AlertInfo.show({
  1. required BuildContext context,
  2. required String text,
  3. MessagePosition position = MessagePosition.top,
  4. double padding = 30.0,
  5. int duration = 3,
  6. TypeInfo typeInfo = TypeInfo.info,
  7. Color? backgroundColor,
  8. Color? textColor,
  9. Color? iconColor,
  10. Color? actionColor,
  11. String? action,
  12. Function? actionCallback,
  13. 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

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();
}