CommonSnackBar.warning constructor
CommonSnackBar.warning({
- Key? key,
- required BuildContext context,
- required String text,
- SnackBarAction? action,
Implementation
CommonSnackBar.warning({
super.key,
required BuildContext context,
required String text,
super.action,
}) : super(
content: Row(
children: [
const Icon(Icons.warning_amber, size: 24, color: Colors.orange),
const SizedBox(width: 8),
Expanded(
child: Text(
text,
style: context.textTheme.bodyMedium?.copyWith(
color: Colors.orange,
),
),
),
],
),
backgroundColor: Colors.orange.withValues(alpha: .1),
margin: const EdgeInsets.only(left: 20, right: 20, bottom: 32),
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
behavior: SnackBarBehavior.floating,
);