showSuccessSnack function
void
showSuccessSnack({})
Shows a floating success snackbar at the bottom.
Implementation
void showSuccessSnack({
String title = 'Success',
required String message,
Duration duration = const Duration(seconds: 2),
}) {
Get.snackbar(
title,
message,
snackPosition: SnackPosition.BOTTOM,
backgroundColor: AppColors.successColor,
colorText: Colors.white,
margin: const EdgeInsets.all(16),
borderRadius: 8,
snackStyle: SnackStyle.FLOATING,
duration: duration,
titleText: Text(
title,
style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
messageText: Text(message, style: const TextStyle(color: Colors.white)),
icon: const Icon(Icons.check_circle, color: Colors.white),
);
}