Skip to content

Commit ea63162

Browse files
committed
chore: better responsive layout in popular page
1 parent b79483d commit ea63162

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/pages/popular/popular_page.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,13 @@ class _PopularPageState extends State<PopularPage>
164164
}
165165

166166
Widget contentGrid(bangumiList) {
167-
int crossCount =
168-
MediaQuery.of(context).orientation != Orientation.portrait ? 6 : 3;
167+
int crossCount = 3;
168+
if (MediaQuery.sizeOf(context).width > LayoutBreakpoint.compact['width']!) {
169+
crossCount = 5;
170+
}
171+
if (MediaQuery.sizeOf(context).width > LayoutBreakpoint.medium['width']!) {
172+
crossCount = 6;
173+
}
169174
return SliverGrid(
170175
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
171176
// 行间距

0 commit comments

Comments
 (0)