I know with a ListView or SingleChildScrollView RefreshIndicator just works natively but I want to use a RefreshIndicator on a page that doesn't scroll. Is this even possible and if so, how?
To disable RefreshIndicator pass notificationPredicate function that returns false. After doing that refresh indicator won't be shown or onRefresh called.
Physics simulation in Flutter is a beautiful way to Animate components of the flutter app to make it look more realistic and interactive. These can be used to create a range of animations like falling objects due to gravity to making a container seem attached to a spring.
You must do the following:
SingleChildScrollView with the property physics set to AlwaysScrollableScrollPhysics().MediaQuery.of(context).size.height.The complete example:
classs MyWidget extends StatelessWidget { @override Widget build(BuildContext context) { return RefreshIndicator( onRefresh: () {}, child: SingleChildScrollView( physics: AlwaysScrollableScrollPhysics(), child: Container( child: Center( child: Text('Hello World'), ), height: MediaQuery.of(context).size.height, ), ), ); } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With