show static method

void show(
  1. BuildContext context,
  2. String title,
  3. String message,
  4. MessageConfig config,
)

Implementation

static void show(
  BuildContext context,
  String title,
  String message,
  MessageConfig config,
) {
  showDialog(
    context: context,
    builder:
        (_) => AlertDialog(
          backgroundColor: config.backgroundColor,
          title: Row(
            children: [
              Icon(config.icon, color: config.textColor),
              const SizedBox(width: 8),
              Text(title, style: TextStyle(color: config.textColor)),
            ],
          ),
          content: Text(message, style: TextStyle(color: config.textColor)),
          actions: [
            TextButton(
              child: Text('OK', style: TextStyle(color: config.textColor)),
              onPressed: () => Navigator.of(context).pop(),
            ),
          ],
        ),
  );
}