showSuccessSnackBar function

void showSuccessSnackBar({
  1. required String message,
  2. required BuildContext context,
})

Implementation

void showSuccessSnackBar({
  required String message,
  required BuildContext context,
}) {
  ScaffoldMessenger.of(context).showSnackBar(
    SnackBar(
      duration: const Duration(seconds: 2),
      behavior: SnackBarBehavior.floating,
      backgroundColor: Colors.green.shade900,
      content: Text(
        message,
        style: const TextStyle(color: Colors.white),
      ),
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(10),
      ),
    ),
  );
}