Created
August 22, 2021 00:53
-
-
Save rohan20/e442c6933c0e3a7e1e96d29fc0ad6727 to your computer and use it in GitHub Desktop.
Flutter pull to refresh without ListView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(DemoApp()); | |
} | |
class DemoApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
body: RefreshIndicator( | |
onRefresh: () async { | |
await Future.delayed(const Duration(seconds: 1)); | |
}, | |
child: CustomScrollView( | |
slivers: <Widget>[ | |
SliverFillRemaining( | |
child: Container( | |
color: Colors.blue, | |
child: Center( | |
child: Text("No results found."), | |
), | |
), | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
StackOverflow answer: https://stackoverflow.com/a/68877757/5066615