JavierSegoviaCordoba
JavierSegoviaCordoba

Reputation: 6631

RefreshIndicator: show without launch onRefresh

Is there any way to achieve this behavior?

Currently when I use the addPostFrameacallback to force the state to show the indicator, it launch the onRefresh function.

Upvotes: 0

Views: 1142

Answers (2)

klydra
klydra

Reputation: 153

To show the RefreshIndicator manually, just attach the RefreshIndicator() to a GlobalKey<RefreshIndicatorState> by adding the previously created GlobalKey<RefreshIndicatorState> to the key: property of the RefreshIndicator(), and trigger it anytime by running _refreshKey.currentState.show();.

Upvotes: 2

Thor
Thor

Reputation: 559

If you want to use the indicator as a loading icon, can't you instead use CircularProgressIndicator and animate it to act the same way?

Upvotes: 0

Related Questions