Skip to content

Instantly share code, notes, and snippets.

@fabiojansenbr
Created December 5, 2019 15:54
Show Gist options
  • Save fabiojansenbr/d7142bb881830368f1029424fdb0b8e5 to your computer and use it in GitHub Desktop.
Save fabiojansenbr/d7142bb881830368f1029424fdb0b8e5 to your computer and use it in GitHub Desktop.
_loadFromApi() async {
setState(() {
isLoading = true;
});
var apiProvider = EmployeeApiProvider();
await apiProvider.getAllEmployees();
// wait for 2 seconds to simulate loading of data
await Future.delayed(const Duration(seconds: 2));
setState(() {
isLoading = false;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment