Skip to content

Instantly share code, notes, and snippets.

@e200
Last active May 21, 2020 12:34
Show Gist options
  • Save e200/d9c53b68db23cce610d205faf7640192 to your computer and use it in GitHub Desktop.
Save e200/d9c53b68db23cce610d205faf7640192 to your computer and use it in GitHub Desktop.
_fetch() {
_http.get('/posts?_start=$_page&_limit=$_limit')
.then((response) {
final _fetchedPosts = (response.data as List)
.map((_user) => {
'id': _user['id'],
'title': _user['title'],
'body': 'body',
})
.toList();
setState(() {
_posts.addAll(_fetchedPosts);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment