Skip to content

Commit 3611ef8

Browse files
committed
adaptive ui 2
1 parent f19b28f commit 3611ef8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/pages/bookmarks.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ class _BookmarksArticlesListState extends State<BookmarksArticlesList> {
4040
valueListenable: store.bookmarks(),
4141
builder: (context, box, _) {
4242
final habrStorage = context.watch<HabrStorage>();
43-
final bookmarks = box.values;
44-
final previews =
45-
bookmarks.map((e) => buildItem(context, e, habrStorage)).toList();
46-
if (previews.isEmpty) return Center(child: EmptyContent());
47-
return ListView(
48-
children: previews,
49-
);
43+
final bookmarks = box.values.toList();
44+
if (bookmarks.isEmpty) return Center(child: EmptyContent());
45+
return ListView.separated(
46+
itemBuilder: (context, i) => DefaultConstraints(
47+
child: buildItem(context, bookmarks[i], habrStorage)),
48+
separatorBuilder: (_, __) => const DefaultConstraints(child: Hr()),
49+
itemCount: bookmarks.length);
5050
},
5151
);
5252
}

0 commit comments

Comments
 (0)