Add refresh support for gallery page

This commit is contained in:
2024-06-02 10:35:17 +00:00
committed by GitHub
parent 606ddc6721
commit 6d0e7d747d
5 changed files with 38 additions and 7 deletions

View File

@@ -36,6 +36,8 @@ class GalleryPage extends StatefulWidget {
class _GalleryPage extends State<GalleryPage>
with ThemeModeWidget, IsTopWidget2 {
_GalleryPage();
final GlobalKey<RefreshIndicatorState> _refreshIndicatorKey =
GlobalKey<RefreshIndicatorState>();
int _gid = 0;
GalleryData? _data;
EhFiles? _files;
@@ -136,7 +138,11 @@ class _GalleryPage extends State<GalleryPage>
body: isLoading
? const Center(child: CircularProgressIndicator())
: _data != null
? GalleryInfo(_data!, files: _files)
? GalleryInfo(_data!,
files: _files, refreshIndicatorKey: _refreshIndicatorKey,
onRefresh: () async {
await _fetchData();
})
: Center(
child: Text("Error: $_error"),
));