bharat_erp/lib/shared/widgets/app_empty_state.dart
SurendarSuri30 8f852ac4f6 Initial commit: Bharat ERP Flutter application.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 15:04:06 +05:30

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!,
],
],
),
),
);
}
}