showToast static method
Implementation
static void showToast(
BuildContext context, {
required String message,
bool isError = false,
}) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
duration: const Duration(milliseconds: 500),
content: Row(
children: [
Icon(
isError ? Icons.error_outline : Icons.check_circle,
color: context.appColor.textPrimary,
size: 20,
),
const SizedBox(width: 8),
Expanded(child: Text(message, style: context.f16MediumTextPrimary)),
],
),
behavior: SnackBarBehavior.floating,
backgroundColor: isError ? Colors.redAccent : Colors.green,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
),
);
}