forked from hesabix/arc
71 lines
2 KiB
Dart
71 lines
2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'ai_chat_design.dart';
|
|
|
|
/// حالت خالی یکپارچه برای صفحات و لیستهای AI.
|
|
class AIEmptyState extends StatelessWidget {
|
|
final IconData icon;
|
|
final String title;
|
|
final String? subtitle;
|
|
final Widget? action;
|
|
|
|
const AIEmptyState({
|
|
super.key,
|
|
required this.icon,
|
|
required this.title,
|
|
this.subtitle,
|
|
this.action,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
final scheme = theme.colorScheme;
|
|
|
|
return Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(32),
|
|
child: ConstrainedBox(
|
|
constraints: const BoxConstraints(maxWidth: 360),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Container(
|
|
width: 72,
|
|
height: 72,
|
|
decoration: BoxDecoration(
|
|
color: scheme.primaryContainer.withValues(alpha: 0.35),
|
|
borderRadius: BorderRadius.circular(AIChatDesign.cardRadius),
|
|
),
|
|
child: Icon(icon, size: 36, color: scheme.primary),
|
|
),
|
|
const SizedBox(height: 20),
|
|
Text(
|
|
title,
|
|
textAlign: TextAlign.center,
|
|
style: theme.textTheme.titleMedium?.copyWith(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
if (subtitle != null) ...[
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
subtitle!,
|
|
textAlign: TextAlign.center,
|
|
style: theme.textTheme.bodyMedium?.copyWith(
|
|
color: scheme.onSurfaceVariant,
|
|
height: 1.5,
|
|
),
|
|
),
|
|
],
|
|
if (action != null) ...[
|
|
const SizedBox(height: 20),
|
|
action!,
|
|
],
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|