ui: transparent compact AppBar (64dp → 44dp)

- AppBar background transparent, merges with scaffold for seamless look
- toolbarHeight reduced from 64dp to 44dp (~20dp screen space saved)
- scrolledUnderElevation: 0 prevents Material 3 shadow on scroll
- Icons 24→20px with VisualDensity.compact for tighter action buttons
- Title fontSize 16 w600, less visual weight
- Both dark and light themes updated consistently

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-28 05:20:23 -08:00
parent ed39518a71
commit 3025910095
2 changed files with 14 additions and 9 deletions

View File

@ -13,8 +13,10 @@ class AppTheme {
),
scaffoldBackgroundColor: AppColors.background,
appBarTheme: const AppBarTheme(
backgroundColor: AppColors.surface,
backgroundColor: Colors.transparent,
elevation: 0,
scrolledUnderElevation: 0,
toolbarHeight: 44,
),
cardTheme: CardThemeData(
color: AppColors.surface,
@ -66,8 +68,10 @@ class AppTheme {
),
scaffoldBackgroundColor: const Color(0xFFF1F5F9),
appBarTheme: const AppBarTheme(
backgroundColor: Colors.white,
backgroundColor: Colors.transparent,
elevation: 0,
scrolledUnderElevation: 0,
toolbarHeight: 44,
foregroundColor: Color(0xFF1E293B),
),
cardTheme: CardThemeData(

View File

@ -476,27 +476,28 @@ class _ChatPageState extends ConsumerState<ChatPage> {
return Scaffold(
drawer: const ConversationDrawer(),
appBar: AppBar(
title: const Text('iAgent'),
title: const Text('iAgent', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600)),
actions: [
// New chat button (always visible)
IconButton(
icon: const Icon(Icons.edit_outlined),
icon: const Icon(Icons.edit_outlined, size: 20),
tooltip: '新对话',
visualDensity: VisualDensity.compact,
onPressed: () => ref.read(chatProvider.notifier).startNewChat(),
),
// Stop button during streaming
if (chatState.isStreaming)
IconButton(
icon: const Icon(Icons.stop_circle_outlined),
icon: const Icon(Icons.stop_circle_outlined, size: 20),
tooltip: '停止',
visualDensity: VisualDensity.compact,
onPressed: () => ref.read(chatProvider.notifier).cancelCurrentTask(),
),
// Voice call button
IconButton(
icon: const Icon(Icons.call),
icon: const Icon(Icons.call, size: 20),
tooltip: '语音通话',
visualDensity: VisualDensity.compact,
onPressed: _openVoiceCall,
),
const SizedBox(width: 4),
],
),
body: SafeArea(