mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-24 18:38:48 +01:00
Keep the refresh indicator until done
This commit is contained in:
parent
50599f2ba5
commit
cc5046ee8e
1 changed files with 10 additions and 0 deletions
|
@ -130,6 +130,7 @@ class _HomePhotosState extends State<HomePhotos>
|
|||
backgroundColor: Colors.grey[100],
|
||||
onRefresh: () async {
|
||||
_onRefreshSelected();
|
||||
await _waitRefresh();
|
||||
},
|
||||
child: CustomScrollView(
|
||||
controller: _scrollController,
|
||||
|
@ -579,6 +580,15 @@ class _HomePhotosState extends State<HomePhotos>
|
|||
_bloc.add(const ScanAccountDirBlocRefresh());
|
||||
}
|
||||
|
||||
Future<void> _waitRefresh() async {
|
||||
while (true) {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
if (_bloc.state is! ScanAccountDirBlocLoading) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _setThumbZoomLevel(int level) {
|
||||
final prevLevel = _thumbZoomLevel;
|
||||
_thumbZoomLevel = level;
|
||||
|
|
Loading…
Reference in a new issue