CommonSnackBar.error constructor

CommonSnackBar.error({
  1. Key? key,
  2. required BuildContext context,
  3. required String text,
  4. SnackBarAction? action,
})

Implementation

CommonSnackBar.error({
  super.key,
  required BuildContext context,
  required String text,
  super.action,
}) : super(
       content: Row(
         children: [
           Icon(Icons.close, size: 24, color: context.colors.onError),
           const SizedBox(width: 8),
           Expanded(
             child: Text(
               text,
               style: context.textTheme.bodyMedium?.copyWith(
                 color: context.colors.onError,
               ),
             ),
           ),
         ],
       ),
       backgroundColor: context.colors.error,
       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,
     );