RTechSweetAlert function
void
RTechSweetAlert({})
Implementation
void RTechSweetAlert({
required BuildContext context,
required IconData icon,
required String title,
required String description,
required Color iconColor,
required Color backgroundColor,
required Color titleBackgroundColor,
required Color titleColor,
required Color descriptionColor,
}) {
showDialog(
context: context,
barrierDismissible: true,
builder: (ctx) {
return Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
child: Container(
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: BorderRadius.circular(20),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.all(20),
width: double.infinity,
color: titleBackgroundColor,
child: Icon(icon, color: iconColor, size: 60),
),
const SizedBox(height: 16),
Container(
padding: EdgeInsets.all(20),
child: Column(
children: [
Text(
title,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.bold,
color: titleColor,
),
),
const SizedBox(height: 8),
Text(
description,
style: TextStyle(
fontSize: 16,
color: descriptionColor,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.black,
foregroundColor: const Color(0xFF4169E1),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
onPressed: () => Navigator.of(ctx).pop(),
child: const Text(
"OK",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
],
),
),
],
),
),
);
},
);
}