generated from dellevin/template
优化界面功能
This commit is contained in:
@@ -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
|
/// 构建顶部 AppBar
|
||||||
Widget _buildSliverAppBar(Book book) {
|
Widget _buildSliverAppBar(Book book) {
|
||||||
final hasCover = book.coverPath != null && book.coverPath!.isNotEmpty;
|
final hasCover = book.coverPath != null && book.coverPath!.isNotEmpty;
|
||||||
@@ -137,6 +163,7 @@ class _BookDetailPageState extends State<BookDetailPage> {
|
|||||||
expandedHeight: 320,
|
expandedHeight: 320,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
backgroundColor: const Color(0xFFF5F5F5),
|
backgroundColor: const Color(0xFFF5F5F5),
|
||||||
|
leading: _buildBackButton(),
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
background: _buildCoverSection(book),
|
background: _buildCoverSection(book),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -66,12 +66,20 @@ class _BookExcerptsPageState extends State<BookExcerptsPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
Container(
|
||||||
Icons.format_quote_outlined,
|
width: 80,
|
||||||
size: 64,
|
height: 80,
|
||||||
color: Color(0xFFCCCCCC),
|
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(
|
const Text(
|
||||||
'暂无摘抄',
|
'暂无摘抄',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -80,14 +88,23 @@ class _BookExcerptsPageState extends State<BookExcerptsPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
OutlinedButton(
|
InkWell(
|
||||||
onPressed: () => _navigateToAddExcerpt(),
|
onTap: () => _navigateToAddExcerpt(),
|
||||||
style: OutlinedButton.styleFrom(
|
child: Container(
|
||||||
foregroundColor: const Color(0xFF1A1A1A),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||||
side: const BorderSide(color: Color(0xFF1A1A1A)),
|
decoration: BoxDecoration(
|
||||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero),
|
color: const Color(0xFF1A1A1A),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
'添加记录',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: const Text('添加摘抄'),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -116,12 +116,20 @@ class _BookReviewsPageState extends State<BookReviewsPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
Container(
|
||||||
Icons.rate_review_outlined,
|
width: 80,
|
||||||
size: 64,
|
height: 80,
|
||||||
color: Color(0xFFCCCCCC),
|
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(
|
const Text(
|
||||||
'暂无书评',
|
'暂无书评',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -130,14 +138,23 @@ class _BookReviewsPageState extends State<BookReviewsPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
OutlinedButton(
|
InkWell(
|
||||||
onPressed: () => _navigateToAddReview(),
|
onTap: () => _navigateToAddReview(),
|
||||||
style: OutlinedButton.styleFrom(
|
child: Container(
|
||||||
foregroundColor: const Color(0xFF1A1A1A),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||||
side: const BorderSide(color: Color(0xFF1A1A1A)),
|
decoration: BoxDecoration(
|
||||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero),
|
color: const Color(0xFF1A1A1A),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
'添加记录',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: const Text('写书评'),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -129,6 +129,32 @@ class _MovieDetailPageState extends State<MovieDetailPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 构建带背景的返回按钮
|
||||||
|
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
|
/// 构建顶部 AppBar
|
||||||
Widget _buildSliverAppBar(Movie movie) {
|
Widget _buildSliverAppBar(Movie movie) {
|
||||||
final hasPoster = movie.posterPath != null && movie.posterPath!.isNotEmpty;
|
final hasPoster = movie.posterPath != null && movie.posterPath!.isNotEmpty;
|
||||||
@@ -137,6 +163,7 @@ class _MovieDetailPageState extends State<MovieDetailPage> {
|
|||||||
expandedHeight: 320,
|
expandedHeight: 320,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
backgroundColor: const Color(0xFFF5F5F5),
|
backgroundColor: const Color(0xFFF5F5F5),
|
||||||
|
leading: _buildBackButton(),
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
background: _buildPosterSection(movie),
|
background: _buildPosterSection(movie),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -69,12 +69,20 @@ class _MoviePostersPageState extends State<MoviePostersPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
Container(
|
||||||
Icons.photo_library_outlined,
|
width: 80,
|
||||||
size: 64,
|
height: 80,
|
||||||
color: Color(0xFFCCCCCC),
|
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(
|
const Text(
|
||||||
'暂无海报',
|
'暂无海报',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -83,14 +91,23 @@ class _MoviePostersPageState extends State<MoviePostersPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
OutlinedButton(
|
InkWell(
|
||||||
onPressed: _pickPoster,
|
onTap: _pickPoster,
|
||||||
style: OutlinedButton.styleFrom(
|
child: Container(
|
||||||
foregroundColor: const Color(0xFF1A1A1A),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||||
side: const BorderSide(color: Color(0xFF1A1A1A)),
|
decoration: BoxDecoration(
|
||||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero),
|
color: const Color(0xFF1A1A1A),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
'添加记录',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: const Text('添加海报'),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -116,12 +116,20 @@ class _MovieReviewsPageState extends State<MovieReviewsPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
Container(
|
||||||
Icons.rate_review_outlined,
|
width: 80,
|
||||||
size: 64,
|
height: 80,
|
||||||
color: Color(0xFFCCCCCC),
|
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(
|
const Text(
|
||||||
'暂无影评',
|
'暂无影评',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -130,14 +138,23 @@ class _MovieReviewsPageState extends State<MovieReviewsPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
OutlinedButton(
|
InkWell(
|
||||||
onPressed: () => _navigateToAddReview(),
|
onTap: () => _navigateToAddReview(),
|
||||||
style: OutlinedButton.styleFrom(
|
child: Container(
|
||||||
foregroundColor: const Color(0xFF1A1A1A),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||||
side: const BorderSide(color: Color(0xFF1A1A1A)),
|
decoration: BoxDecoration(
|
||||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero),
|
color: const Color(0xFF1A1A1A),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
'添加记录',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: const Text('写影评'),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -60,17 +60,10 @@ class CustomBottomNavBar extends StatelessWidget {
|
|||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Container(
|
child: Icon(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
|
isActive ? activeIcon : icon,
|
||||||
decoration: BoxDecoration(
|
color: isActive ? const Color(0xFF1A1A1A) : const Color(0xFF999999),
|
||||||
color: isActive ? const Color(0xFF1A1A1A) : Colors.transparent,
|
size: 28,
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Icon(
|
|
||||||
isActive ? activeIcon : icon,
|
|
||||||
color: isActive ? Colors.white : const Color(0xFF999999),
|
|
||||||
size: 22,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user