import 'package:flutter/material.dart';
import '../../app/theme.dart';
class EmptyState extends StatelessWidget {
const EmptyState({
super.key,
required this.icon,
required this.title,
required this.description,
required this.actionLabel,
required this.onPressed,
});
final IconData icon;
final String title;
final String description;
final String actionLabel;
final VoidCallback onPressed;
@override
Widget build(BuildContext context) => Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 520),
child: Card(
child: Padding(
padding: const EdgeInsets.all(36),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
width: 72,
height: 72,
decoration: BoxDecoration(
color: AppColors.canvas,
borderRadius: BorderRadius.circular(22),
),
child: Icon(icon, size: 34, color: AppColors.green),
),
const SizedBox(height: 24),
Text(
title,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w800,
),
),
const SizedBox(height: 10),
Text(
description,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge,
),
const SizedBox(height: 24),
FilledButton.icon(
onPressed: onPressed,
icon: const Icon(Icons.add_rounded),
label: Text(actionLabel),
),
],
),
),
),
),
);
}
