This commit is contained in:
2026-06-03 14:07:10 +08:00
parent 3bdece45c3
commit 9eb8d1cc37
118 changed files with 5689 additions and 2 deletions

View File

@@ -0,0 +1,45 @@
import 'package:flutter/material.dart';
class AppEmptyView extends StatelessWidget {
const AppEmptyView({
super.key,
this.title = '暂无数据',
this.message,
this.icon = Icons.inbox_outlined,
this.action,
});
final String title;
final String? message;
final IconData icon;
final Widget? action;
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
return Center(
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, size: 56, color: colors.outline),
const SizedBox(height: 12),
Text(title, style: Theme.of(context).textTheme.titleMedium),
if (message != null) ...[
const SizedBox(height: 6),
Text(
message!,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: colors.onSurfaceVariant,
),
),
],
if (action != null) ...[const SizedBox(height: 16), action!],
],
),
),
);
}
}