| 12345678910111213141516171819202122232425262728293031323334353637 |
- import 'package:flutter/material.dart';
- class EmptyState extends StatelessWidget {
- final IconData icon;
- final String title;
- final String? subtitle;
- const EmptyState({
- super.key,
- required this.icon,
- required this.title,
- this.subtitle,
- });
- @override
- Widget build(BuildContext context) {
- return Center(
- child: Padding(
- padding: const EdgeInsets.all(32),
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Icon(icon, size: 64, color: Theme.of(context).colorScheme.outline),
- const SizedBox(height: 16),
- Text(title, style: Theme.of(context).textTheme.titleMedium),
- if (subtitle != null) ...[
- const SizedBox(height: 8),
- Text(subtitle!, style: Theme.of(context).textTheme.bodyMedium?.copyWith(
- color: Theme.of(context).colorScheme.outline,
- )),
- ],
- ],
- ),
- ),
- );
- }
- }
|