优化我的界面hero区域

This commit is contained in:
DelLevin-Home
2026-08-10 21:13:12 +08:00
parent 5060cae626
commit ce5007bbaa

View File

@@ -263,18 +263,19 @@ class _ProfilePageState extends State<ProfilePage> with RouteAware {
} }
Widget _buildPosterMosaic(List<String> paths) { Widget _buildPosterMosaic(List<String> paths) {
final posters = paths.take(12).toList(); const cellCount = 30;
while (posters.length < 12) final posters = paths.take(cellCount).toList();
while (posters.length < cellCount)
posters.add(posters[posters.length % paths.length]); posters.add(posters[posters.length % paths.length]);
return GridView.builder( return GridView.builder(
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4, crossAxisCount: 6,
mainAxisSpacing: 2, mainAxisSpacing: 1.5,
crossAxisSpacing: 2, crossAxisSpacing: 1.5,
), ),
itemCount: 12, itemCount: cellCount,
itemBuilder: (_, i) => itemBuilder: (_, i) =>
FadeInLocalImage(path: posters[i], fit: BoxFit.cover), FadeInLocalImage(path: posters[i], fit: BoxFit.cover),
); );