RefreshIndicator can be shown when dragging from non-zero scroll position (#71303)

This commit is contained in:
xubaolin
2020-12-04 05:28:04 +08:00
committed by GitHub
parent 4e85a67f3e
commit 8817c0d28c
3 changed files with 74 additions and 3 deletions

View File

@@ -27,8 +27,10 @@ class OverscrollDemoState extends State<OverscrollDemo> {
Future<void> _handleRefresh() {
final Completer<void> completer = Completer<void>();
Timer(const Duration(seconds: 3), () { completer.complete(); });
Timer(const Duration(seconds: 3), () => completer.complete());
return completer.future.then((_) {
if (!mounted)
return;
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: const Text('Refresh complete'),
action: SnackBarAction(