import 'package:flutter/material.dart'; /// 空态 + 引导动作 class EmptyView extends StatelessWidget { final String message; final String? actionText; final VoidCallback? onAction; const EmptyView({ super.key, required this.message, this.actionText, this.onAction, }); @override Widget build(BuildContext context) { return Center( child: Column( mainAxisSize: MainAxisSize.min, children: [ Icon(Icons.inbox_outlined, size: 48, color: Colors.grey.shade400), const SizedBox(height: 12), Text(message, style: const TextStyle(color: Colors.grey)), if (actionText != null && onAction != null) ...[ const SizedBox(height: 16), FilledButton(onPressed: onAction, child: Text(actionText!)), ], ], ), ); } }