showErrorSnack function
void
showErrorSnack({})
Shows a floating error snackbar at the bottom.
Implementation
void showErrorSnack({
String title = 'Error',
required String message,
Duration duration = const Duration(seconds: 3),
}) {
Get.snackbar(
title,
message,
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red.withOpacity(0.95),
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.error, color: Colors.white),
);
}