48 lines
1.3 KiB
Dart
48 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class AppEmptyState extends StatelessWidget {
|
|
const AppEmptyState({
|
|
super.key,
|
|
required this.title,
|
|
this.description,
|
|
this.icon = Icons.inbox_outlined,
|
|
this.action,
|
|
});
|
|
|
|
final String title;
|
|
final String? description;
|
|
final IconData icon;
|
|
final Widget? action;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(32),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Icon(icon, size: 56, color: Theme.of(context).colorScheme.outline),
|
|
const SizedBox(height: 16),
|
|
Text(title, style: Theme.of(context).textTheme.titleMedium),
|
|
if (description != null) ...[
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
description!,
|
|
textAlign: TextAlign.center,
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
],
|
|
if (action != null) ...[
|
|
const SizedBox(height: 20),
|
|
action!,
|
|
],
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|