showProKitSnackBar function

void showProKitSnackBar(
  1. BuildContext context, {
  2. String? title,
  3. String? message,
  4. required ProKitSnackBarType snackBarType,
  5. ProKitNotificationType? notificationType,
  6. ProKitSnackBarPosition? snackBarPosition,
  7. Color? color,
  8. bool autoClose = true,
  9. Duration autoCloseDuration = const Duration(seconds: 4),
  10. double? width,
  11. double? height,
  12. TextStyle? titleTextStyle,
  13. TextStyle? messageTextStyle,
  14. Widget? customIcon,
})

Show ProKit SnackBar

Implementation

void showProKitSnackBar(
  BuildContext context, {
  String? title,
  String? message,
  required ProKitSnackBarType snackBarType,
  ProKitNotificationType? notificationType,
  ProKitSnackBarPosition? snackBarPosition,
  Color? color,
  bool autoClose = true,
  Duration autoCloseDuration = const Duration(seconds: 4),
  double? width,
  double? height,
  TextStyle? titleTextStyle,
  TextStyle? messageTextStyle,
  Widget? customIcon,
}) {
  ProKitSnackBar snackBar = ProKitSnackBar(
    title: title ?? "Notification",

    /// Default title if none provided
    message: message ?? "This is a default message",

    /// Default message
    notificationType: notificationType ?? ProKitNotificationType.success,

    ///Default notification type
    proKitSnackBarPosition: snackBarPosition ?? ProKitSnackBarPosition.bottomCenter,

    /// Default position
    color: color,

    /// User can specify a color or default to notificationType color
    autoClose: autoClose,

    /// Handle auto close
    autoCloseDuration: autoCloseDuration,
    // User-defined or default auto-close duration
    width: width,

    /// Customizable width
    height: height,

    /// Customizable height
    titleTextStyle: titleTextStyle,

    /// Customizable title text style
    messageTextStyle: messageTextStyle,

    /// Customizable message text style
    customIcon: customIcon,

    /// SnackBar Type
    snackBarType: snackBarType,
  );
  snackBar.showCustomSnackBar(context, snackBar);
}