import 'package:flutter/material.dart'; enum AlertType { success, error, info } class AlertArguments { final String title; final String message; final String actionTitle; final AlertType type; final VoidCallback onActionPressed; AlertArguments({ this.title = '', required this.message, required this.actionTitle, required this.type, required this.onActionPressed, }); } class AlertScreen extends StatelessWidget { final AlertArguments arguments; const AlertScreen({super.key, required this.arguments}); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: SafeArea( child: Padding( padding: const EdgeInsets.symmetric(horizontal: 24.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ Icon( arguments.type == AlertType.success ? Icons.thumb_up_outlined : arguments.type == AlertType.error ? Icons.thumb_down_outlined : Icons.info_outline, size: 150, color: arguments.type == AlertType.error ? Colors.red : arguments.type == AlertType.success ? Colors.lightBlue : Theme.of(context).colorScheme.primary, ), const SizedBox(height: 32), if (arguments.title.isNotEmpty) ...[ Text( arguments.title, style: const TextStyle( fontSize: 40, fontWeight: FontWeight.bold, color: Colors.black, ), textAlign: TextAlign.start, ), ], Text( arguments.message, style: const TextStyle( fontSize: 16, color: Colors.grey, ), textAlign: TextAlign.start, ), const SizedBox(height: 20), TextButton( style: TextButton.styleFrom( padding: const EdgeInsets.symmetric(vertical: 16), ), onPressed: arguments.onActionPressed, child: Text( arguments.actionTitle, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 18, color: arguments.type == AlertType.error ? Colors.red : Colors.lightBlue, ), ), ), ], ), ), ), ); } }