mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
Use CustomScrollView
This commit is contained in:
25
lib/components/thumbnail_gridview.dart
Normal file
25
lib/components/thumbnail_gridview.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../api/file.dart';
|
||||
import '../api/gallery.dart';
|
||||
import 'thumbnail.dart';
|
||||
|
||||
class ThumbnailGridView extends StatelessWidget {
|
||||
const ThumbnailGridView(this.pages, this.gridDelegate, {Key? key, this.files})
|
||||
: super(key: key);
|
||||
final List<ExtendedPMeta> pages;
|
||||
final EhFiles? files;
|
||||
final SliverGridDelegate gridDelegate;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SliverGrid.builder(
|
||||
gridDelegate: gridDelegate,
|
||||
itemCount: pages.length,
|
||||
itemBuilder: (context, index) {
|
||||
final page = pages[index]!;
|
||||
final fileId =
|
||||
files != null ? files!.files[page.token]!.first.id : null;
|
||||
return Thumbnail(page, fileId: fileId);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user