优化我的界面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) {
final posters = paths.take(12).toList();
while (posters.length < 12)
const cellCount = 30;
final posters = paths.take(cellCount).toList();
while (posters.length < cellCount)
posters.add(posters[posters.length % paths.length]);
return GridView.builder(
physics: const NeverScrollableScrollPhysics(),
padding: EdgeInsets.zero,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
mainAxisSpacing: 2,
crossAxisSpacing: 2,
crossAxisCount: 6,
mainAxisSpacing: 1.5,
crossAxisSpacing: 1.5,
),
itemCount: 12,
itemCount: cellCount,
itemBuilder: (_, i) =>
FadeInLocalImage(path: posters[i], fit: BoxFit.cover),
);