refactor: 重构聊天数据层至core并简化首页UI
This commit is contained in:
@@ -393,12 +393,6 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
try {
|
||||
if (hasEarlierHistory) {
|
||||
await _loadMoreHistoryPreservingViewport(chatBloc);
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
context.l10n.homeNoEarlierHistory,
|
||||
type: ToastType.info,
|
||||
);
|
||||
}
|
||||
_applyViewportDecision(
|
||||
_dispatchViewportEvent(
|
||||
@@ -687,29 +681,6 @@ class _HomeEmptyStateAmbient extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
return Center(
|
||||
child: IgnorePointer(
|
||||
child: Container(
|
||||
key: homeEmptyStateAmbientKey,
|
||||
width: double.infinity,
|
||||
height: AppSpacing.xxl * 6,
|
||||
margin: const EdgeInsets.symmetric(horizontal: AppSpacing.xxl),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(AppSpacing.xxl * 2),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [
|
||||
colorScheme.primaryContainer.withValues(alpha: 0.12),
|
||||
colorScheme.primary.withValues(alpha: 0.08),
|
||||
colorScheme.primaryContainer.withValues(alpha: 0.12),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
return const SizedBox.shrink(key: homeEmptyStateAmbientKey);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user