showErrorSnackbar function

void showErrorSnackbar(
  1. BuildContext ctx, [
  2. String? msg,
  3. Color color = Colors.red
])

howErrorSnackbar

Implementation

void showErrorSnackbar(BuildContext ctx,
    [String? msg, Color color = Colors.red]) {
  ScaffoldMessenger.of(ctx).showSnackBar(
    SnackBar(
      backgroundColor: color,
      content: Text(
        msg ?? UserFeedBackTexts.getErrorMessage(),
        style: Theme.of(ctx).textTheme.bodyText2!.copyWith(color: Colors.white),
      ),
      duration: const Duration(seconds: kShortSnackBarDuration),
    ),
  );
  return;
}