showDefaultSnackBar function

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

Implementation

void showDefaultSnackBar({
  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.grey,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(10),
    ),
  );
  ScaffoldMessenger.of(context).showSnackBar(snackBar);
}