From ce31dbcf8c009414b45dc0fa81970b6cfb0ec880 Mon Sep 17 00:00:00 2001 From: DelLevin-Home Date: Fri, 13 Mar 2026 18:21:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=95=8C=E9=9D=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/book/book_detail_page.dart | 27 ++++++++++++++++ lib/pages/book/book_excerpts_page.dart | 41 +++++++++++++++++------- lib/pages/book/book_reviews_page.dart | 41 +++++++++++++++++------- lib/pages/movies/movie_detail_page.dart | 27 ++++++++++++++++ lib/pages/movies/movie_posters_page.dart | 41 +++++++++++++++++------- lib/pages/movies/movie_reviews_page.dart | 41 +++++++++++++++++------- lib/widgets/bottom_nav_bar.dart | 15 +++------ 7 files changed, 174 insertions(+), 59 deletions(-) diff --git a/lib/pages/book/book_detail_page.dart b/lib/pages/book/book_detail_page.dart index 00badaa..e00bf0c 100644 --- a/lib/pages/book/book_detail_page.dart +++ b/lib/pages/book/book_detail_page.dart @@ -129,6 +129,32 @@ class _BookDetailPageState extends State { ); } + /// 构建带背景的返回按钮 + 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 { expandedHeight: 320, pinned: true, backgroundColor: const Color(0xFFF5F5F5), + leading: _buildBackButton(), flexibleSpace: FlexibleSpaceBar( background: _buildCoverSection(book), ), diff --git a/lib/pages/book/book_excerpts_page.dart b/lib/pages/book/book_excerpts_page.dart index 97618a7..758ea2e 100644 --- a/lib/pages/book/book_excerpts_page.dart +++ b/lib/pages/book/book_excerpts_page.dart @@ -66,12 +66,20 @@ class _BookExcerptsPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Icon( - Icons.format_quote_outlined, - size: 64, - color: Color(0xFFCCCCCC), + Container( + width: 80, + height: 80, + decoration: BoxDecoration( + color: const Color(0xFFF5F5F5), + borderRadius: BorderRadius.circular(20), + ), + child: const Icon( + Icons.format_quote_outlined, + size: 40, + color: Color(0xFFCCCCCC), + ), ), - const SizedBox(height: 16), + const SizedBox(height: 20), const Text( '暂无摘抄', style: TextStyle( @@ -80,14 +88,23 @@ class _BookExcerptsPageState extends State { ), ), const SizedBox(height: 24), - OutlinedButton( - onPressed: () => _navigateToAddExcerpt(), - style: OutlinedButton.styleFrom( - foregroundColor: const Color(0xFF1A1A1A), - side: const BorderSide(color: Color(0xFF1A1A1A)), - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + InkWell( + onTap: () => _navigateToAddExcerpt(), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), + decoration: BoxDecoration( + color: const Color(0xFF1A1A1A), + borderRadius: BorderRadius.circular(8), + ), + child: const Text( + '添加记录', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.white, + ), + ), ), - child: const Text('添加摘抄'), ), ], ), diff --git a/lib/pages/book/book_reviews_page.dart b/lib/pages/book/book_reviews_page.dart index fb377bf..578f34d 100644 --- a/lib/pages/book/book_reviews_page.dart +++ b/lib/pages/book/book_reviews_page.dart @@ -116,12 +116,20 @@ class _BookReviewsPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Icon( - Icons.rate_review_outlined, - size: 64, - color: Color(0xFFCCCCCC), + Container( + width: 80, + height: 80, + decoration: BoxDecoration( + color: const Color(0xFFF5F5F5), + borderRadius: BorderRadius.circular(20), + ), + child: const Icon( + Icons.rate_review_outlined, + size: 40, + color: Color(0xFFCCCCCC), + ), ), - const SizedBox(height: 16), + const SizedBox(height: 20), const Text( '暂无书评', style: TextStyle( @@ -130,14 +138,23 @@ class _BookReviewsPageState extends State { ), ), const SizedBox(height: 24), - OutlinedButton( - onPressed: () => _navigateToAddReview(), - style: OutlinedButton.styleFrom( - foregroundColor: const Color(0xFF1A1A1A), - side: const BorderSide(color: Color(0xFF1A1A1A)), - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + InkWell( + onTap: () => _navigateToAddReview(), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), + decoration: BoxDecoration( + color: const Color(0xFF1A1A1A), + borderRadius: BorderRadius.circular(8), + ), + child: const Text( + '添加记录', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.white, + ), + ), ), - child: const Text('写书评'), ), ], ), diff --git a/lib/pages/movies/movie_detail_page.dart b/lib/pages/movies/movie_detail_page.dart index 1fa8a1b..4eea7be 100644 --- a/lib/pages/movies/movie_detail_page.dart +++ b/lib/pages/movies/movie_detail_page.dart @@ -129,6 +129,32 @@ class _MovieDetailPageState extends State { ); } + /// 构建带背景的返回按钮 + 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(Movie movie) { final hasPoster = movie.posterPath != null && movie.posterPath!.isNotEmpty; @@ -137,6 +163,7 @@ class _MovieDetailPageState extends State { expandedHeight: 320, pinned: true, backgroundColor: const Color(0xFFF5F5F5), + leading: _buildBackButton(), flexibleSpace: FlexibleSpaceBar( background: _buildPosterSection(movie), ), diff --git a/lib/pages/movies/movie_posters_page.dart b/lib/pages/movies/movie_posters_page.dart index 325b890..86a5c36 100644 --- a/lib/pages/movies/movie_posters_page.dart +++ b/lib/pages/movies/movie_posters_page.dart @@ -69,12 +69,20 @@ class _MoviePostersPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Icon( - Icons.photo_library_outlined, - size: 64, - color: Color(0xFFCCCCCC), + Container( + width: 80, + height: 80, + decoration: BoxDecoration( + color: const Color(0xFFF5F5F5), + borderRadius: BorderRadius.circular(20), + ), + child: const Icon( + Icons.photo_library_outlined, + size: 40, + color: Color(0xFFCCCCCC), + ), ), - const SizedBox(height: 16), + const SizedBox(height: 20), const Text( '暂无海报', style: TextStyle( @@ -83,14 +91,23 @@ class _MoviePostersPageState extends State { ), ), const SizedBox(height: 24), - OutlinedButton( - onPressed: _pickPoster, - style: OutlinedButton.styleFrom( - foregroundColor: const Color(0xFF1A1A1A), - side: const BorderSide(color: Color(0xFF1A1A1A)), - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + InkWell( + onTap: _pickPoster, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), + decoration: BoxDecoration( + color: const Color(0xFF1A1A1A), + borderRadius: BorderRadius.circular(8), + ), + child: const Text( + '添加记录', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.white, + ), + ), ), - child: const Text('添加海报'), ), ], ), diff --git a/lib/pages/movies/movie_reviews_page.dart b/lib/pages/movies/movie_reviews_page.dart index 625fbae..c6573cb 100644 --- a/lib/pages/movies/movie_reviews_page.dart +++ b/lib/pages/movies/movie_reviews_page.dart @@ -116,12 +116,20 @@ class _MovieReviewsPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - const Icon( - Icons.rate_review_outlined, - size: 64, - color: Color(0xFFCCCCCC), + Container( + width: 80, + height: 80, + decoration: BoxDecoration( + color: const Color(0xFFF5F5F5), + borderRadius: BorderRadius.circular(20), + ), + child: const Icon( + Icons.rate_review_outlined, + size: 40, + color: Color(0xFFCCCCCC), + ), ), - const SizedBox(height: 16), + const SizedBox(height: 20), const Text( '暂无影评', style: TextStyle( @@ -130,14 +138,23 @@ class _MovieReviewsPageState extends State { ), ), const SizedBox(height: 24), - OutlinedButton( - onPressed: () => _navigateToAddReview(), - style: OutlinedButton.styleFrom( - foregroundColor: const Color(0xFF1A1A1A), - side: const BorderSide(color: Color(0xFF1A1A1A)), - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), + InkWell( + onTap: () => _navigateToAddReview(), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), + decoration: BoxDecoration( + color: const Color(0xFF1A1A1A), + borderRadius: BorderRadius.circular(8), + ), + child: const Text( + '添加记录', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.white, + ), + ), ), - child: const Text('写影评'), ), ], ), diff --git a/lib/widgets/bottom_nav_bar.dart b/lib/widgets/bottom_nav_bar.dart index a5ec152..162af40 100644 --- a/lib/widgets/bottom_nav_bar.dart +++ b/lib/widgets/bottom_nav_bar.dart @@ -60,17 +60,10 @@ class CustomBottomNavBar extends StatelessWidget { color: Colors.transparent, padding: const EdgeInsets.symmetric(vertical: 10), child: Center( - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8), - decoration: BoxDecoration( - color: isActive ? const Color(0xFF1A1A1A) : Colors.transparent, - borderRadius: BorderRadius.circular(8), - ), - child: Icon( - isActive ? activeIcon : icon, - color: isActive ? Colors.white : const Color(0xFF999999), - size: 22, - ), + child: Icon( + isActive ? activeIcon : icon, + color: isActive ? const Color(0xFF1A1A1A) : const Color(0xFF999999), + size: 28, ), ), ),