showErrorSnackBar function
Implementation
void showErrorSnackBar({
required String message,
required BuildContext context,
}) {
final snackBar = SnackBar(
duration: const Duration(seconds: 2),
behavior: SnackBarBehavior.floating,
content: Container(
margin: const EdgeInsets.all(5),
child: Text(
message,
style: const TextStyle(color: Colors.white),
),
),
backgroundColor: Colors.red,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}