Open in app
Evan Fang
314 Followers
About

Sign in

314 Followers
About
Open in app
Evan Fang

Evan Fang

·Dec 6, 2020

In my opinion, I suggest changing

Future<void> _getData() async {    setState(() {        fetchUsers();    });}

to

Future<void> _getData() async {    return fetchUsers();}

By returning a future task, the refresh indicator will keep loading until `fetchUsers()` finishes.

Implementing Pull-to-refresh in Flutter
330
1

Muhammad Affan Khan

More from Evan Fang

An Android/Flutter engineer at Line Corporation.

More From Medium

Kotlin Coroutines in Android — Channel

Evan Fang in The Startup

Flutter—FutureBuilder

Evan Fang in The Startup

Flutter — Provider and didChangeDependencies()

Evan Fang in The Startup

Flutter — Slivers and CustomScrollView

Evan Fang in The Startup

Kotlin Coroutines in Android — Basics

Evan Fang in The Startup

AutoML Vision — how to train your model?

Evan Fang in Towards Data Science

Flutter — Shimmer Effect

Evan Fang in The Startup

Kotlin Coroutines in Android — Suspending Functions

Evan Fang in The Startup

About

Help

Legal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store