flushbar static method

dynamic flushbar(
  1. String message,
  2. BuildContext context, {
  3. Color? iconColor,
  4. IconData? icon,
  5. Color? backgroundColor,
})

Implementation

static flushbar(
  String message,
  BuildContext context, {
  Color? iconColor,
  IconData? icon,
  Color? backgroundColor,
}) {
  Flushbar(
    forwardAnimationCurve: Curves.decelerate,
    margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
    padding: const EdgeInsets.all(15),
    message: message,
    duration: const Duration(seconds: 3),
    borderRadius: BorderRadius.circular(8),
    flushbarPosition: FlushbarPosition.TOP,
    backgroundColor: backgroundColor ?? Colors.black,
    reverseAnimationCurve: Curves.easeInOut,
    positionOffset: 20,
    icon: Icon(
      icon ?? Icons.error,
      size: 28,
      color: iconColor ?? Colors.white,
    ),
  ).show(context);
}