showWarningSnack method
Shows a styled warning SnackBar.
Implementation
void showWarningSnack(String message, {Duration? duration}) {
messenger
..hideCurrentSnackBar()
..showSnackBar(
SnackBar(
content: Row(
children: <Widget>[
const Icon(Icons.warning_amber_rounded,
color: Colors.white, size: 20),
const SizedBox(width: 10),
Expanded(
child: Text(message,
style: const TextStyle(
color: Colors.white, fontWeight: FontWeight.w500)),
),
],
),
backgroundColor: AppColors.warning,
duration: duration ?? const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
margin: const EdgeInsets.all(16),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadius.medium),
),
),
);
}