优化界面功能

This commit is contained in:
DelLevin-Home
2026-03-13 18:21:40 +08:00
parent bd9b82f6e1
commit ce31dbcf8c
7 changed files with 174 additions and 59 deletions

View File

@@ -129,6 +129,32 @@ class _BookDetailPageState extends State<BookDetailPage> {
);
}
/// 构建带背景的返回按钮
Widget _buildBackButton() {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.3),
borderRadius: BorderRadius.circular(8),
),
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: () => Navigator.pop(context),
borderRadius: BorderRadius.circular(8),
child: Container(
padding: const EdgeInsets.all(8),
child: const Icon(
Icons.arrow_back,
color: Colors.white,
size: 22,
),
),
),
),
);
}
/// 构建顶部 AppBar
Widget _buildSliverAppBar(Book book) {
final hasCover = book.coverPath != null && book.coverPath!.isNotEmpty;
@@ -137,6 +163,7 @@ class _BookDetailPageState extends State<BookDetailPage> {
expandedHeight: 320,
pinned: true,
backgroundColor: const Color(0xFFF5F5F5),
leading: _buildBackButton(),
flexibleSpace: FlexibleSpaceBar(
background: _buildCoverSection(book),
),