Skip to content

Instantly share code, notes, and snippets.

@rohan20
Created August 22, 2021 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rohan20/e442c6933c0e3a7e1e96d29fc0ad6727 to your computer and use it in GitHub Desktop.
Save rohan20/e442c6933c0e3a7e1e96d29fc0ad6727 to your computer and use it in GitHub Desktop.
Flutter pull to refresh without ListView
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."),
),
),
),
],
),
),
),
);
}
}
@rohan20
Copy link
Author

rohan20 commented Aug 22, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment