@@ -15,8 +15,9 @@ class _LibraryScreenState extends State<LibraryScreen> {
1515
1616 List <Book > get _filteredBooks {
1717 return MockLibrary .books.where ((book) {
18- final matchesSearch = book.title.toLowerCase ().contains (_searchQuery.toLowerCase ()) ||
19- book.author.toLowerCase ().contains (_searchQuery.toLowerCase ());
18+ final matchesSearch =
19+ book.title.toLowerCase ().contains (_searchQuery.toLowerCase ()) ||
20+ book.author.toLowerCase ().contains (_searchQuery.toLowerCase ());
2021 final matchesBookmark = ! _showOnlyBookmarked || book.isBookmarked;
2122 return matchesSearch && matchesBookmark;
2223 }).toList ();
@@ -31,11 +32,15 @@ class _LibraryScreenState extends State<LibraryScreen> {
3132 body: CustomScrollView (
3233 slivers: [
3334 SliverAppBar .large (
34- title: const Text ('My Library' , style: TextStyle (fontWeight: FontWeight .bold)),
35+ title: const Text ('My Library' ,
36+ style: TextStyle (fontWeight: FontWeight .bold)),
3537 actions: [
3638 IconButton (
37- icon: Icon (_showOnlyBookmarked ? Icons .bookmark : Icons .bookmark_border),
38- onPressed: () => setState (() => _showOnlyBookmarked = ! _showOnlyBookmarked),
39+ icon: Icon (_showOnlyBookmarked
40+ ? Icons .bookmark
41+ : Icons .bookmark_border),
42+ onPressed: () =>
43+ setState (() => _showOnlyBookmarked = ! _showOnlyBookmarked),
3944 ),
4045 ],
4146 ),
@@ -58,13 +63,16 @@ class _LibraryScreenState extends State<LibraryScreen> {
5863 ),
5964 ),
6065 ),
61-
62- if (recentBooks.isNotEmpty && _searchQuery.isEmpty && ! _showOnlyBookmarked) ...[
66+
67+ if (recentBooks.isNotEmpty &&
68+ _searchQuery.isEmpty &&
69+ ! _showOnlyBookmarked) ...[
6370 const SliverToBoxAdapter (
6471 child: Padding (
6572 padding: EdgeInsets .symmetric (horizontal: 20 , vertical: 8 ),
66- child: Text ('Continue Reading' ,
67- style: TextStyle (fontSize: 18 , fontWeight: FontWeight .bold)),
73+ child: Text ('Continue Reading' ,
74+ style:
75+ TextStyle (fontSize: 18 , fontWeight: FontWeight .bold)),
6876 ),
6977 ),
7078 SliverToBoxAdapter (
@@ -86,8 +94,8 @@ class _LibraryScreenState extends State<LibraryScreen> {
8694 const SliverToBoxAdapter (
8795 child: Padding (
8896 padding: EdgeInsets .symmetric (horizontal: 20 , vertical: 16 ),
89- child: Text ('All Books' ,
90- style: TextStyle (fontSize: 18 , fontWeight: FontWeight .bold)),
97+ child: Text ('All Books' ,
98+ style: TextStyle (fontSize: 18 , fontWeight: FontWeight .bold)),
9199 ),
92100 ),
93101
@@ -99,7 +107,8 @@ class _LibraryScreenState extends State<LibraryScreen> {
99107 children: [
100108 Icon (Icons .library_books, size: 64 , color: Colors .grey),
101109 SizedBox (height: 16 ),
102- Text ('No books found' , style: TextStyle (color: Colors .grey)),
110+ Text ('No books found' ,
111+ style: TextStyle (color: Colors .grey)),
103112 ],
104113 ),
105114 ),
@@ -140,27 +149,32 @@ class _LibraryScreenState extends State<LibraryScreen> {
140149 color: Colors .white,
141150 borderRadius: BorderRadius .circular (16 ),
142151 boxShadow: [
143- BoxShadow (color: Colors .black.withValues (alpha: 0.05 ), blurRadius: 10 ),
152+ BoxShadow (
153+ color: Colors .black.withValues (alpha: 0.05 ), blurRadius: 10 ),
144154 ],
145155 ),
146156 child: Row (
147157 children: [
148158 ClipRRect (
149159 borderRadius: BorderRadius .circular (8 ),
150- child: Image .network (book.coverUrl, width: 80 , height: 120 , fit: BoxFit .cover),
160+ child: Image .network (book.coverUrl,
161+ width: 80 , height: 120 , fit: BoxFit .cover),
151162 ),
152163 const SizedBox (width: 16 ),
153164 Expanded (
154165 child: Column (
155166 mainAxisAlignment: MainAxisAlignment .center,
156167 crossAxisAlignment: CrossAxisAlignment .start,
157168 children: [
158- Text (book.title,
159- style: const TextStyle (fontWeight: FontWeight .bold),
160- maxLines: 2 , overflow: TextOverflow .ellipsis),
161- Text (book.author, style: const TextStyle (fontSize: 12 , color: Colors .grey)),
169+ Text (book.title,
170+ style: const TextStyle (fontWeight: FontWeight .bold),
171+ maxLines: 2 ,
172+ overflow: TextOverflow .ellipsis),
173+ Text (book.author,
174+ style: const TextStyle (fontSize: 12 , color: Colors .grey)),
162175 const Spacer (),
163- const Text ('Last read: 2 hours ago' , style: TextStyle (fontSize: 10 , color: Colors .grey)),
176+ const Text ('Last read: 2 hours ago' ,
177+ style: TextStyle (fontSize: 10 , color: Colors .grey)),
164178 const SizedBox (height: 4 ),
165179 ClipRRect (
166180 borderRadius: BorderRadius .circular (2 ),
@@ -206,7 +220,8 @@ class _LibraryScreenState extends State<LibraryScreen> {
206220 ),
207221 if (book.isBookmarked)
208222 const Positioned (
209- top: 8 , right: 8 ,
223+ top: 8 ,
224+ right: 8 ,
210225 child: Icon (Icons .bookmark, color: Colors .amber, size: 28 ),
211226 ),
212227 ],
0 commit comments