Skip to content

Commit 166665d

Browse files
committed
refactor: enhance book cover widget with conditional border display
1 parent 3d451ec commit 166665d

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

lib/page/book_detail.dart

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ class _BookDetailState extends ConsumerState<BookDetail> {
6969
width: MediaQuery.of(context).size.width,
7070
),
7171
);
72-
return ImageFiltered(
73-
imageFilter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
74-
child: bg,
72+
return Transform.scale(
73+
scale: 1.1,
74+
child: ImageFiltered(
75+
imageFilter: ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
76+
child: bg,
77+
),
7578
);
7679
}
7780

lib/widgets/bookshelf/book_cover.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ class BookCover extends StatefulWidget {
1010
this.height,
1111
this.width,
1212
this.radius,
13+
this.showBorder = true,
1314
});
1415

1516
final Book book;
1617
final double? height;
1718
final double? width;
1819
final double? radius;
20+
final bool showBorder;
1921

2022
@override
2123
State<BookCover> createState() => _BookCoverState();
@@ -84,10 +86,12 @@ class _BookCoverState extends State<BookCover> {
8486

8587
final RoundedSuperellipseBorder borderShape = RoundedSuperellipseBorder(
8688
borderRadius: borderRadius,
87-
side: const BorderSide(
88-
width: 0.3,
89-
color: Colors.grey,
90-
),
89+
side: widget.showBorder
90+
? BorderSide(
91+
width: 0.3,
92+
color: Theme.of(context).dividerColor,
93+
)
94+
: BorderSide.none,
9195
);
9296

9397
return RepaintBoundary(

0 commit comments

Comments
 (0)