Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. final response = await http.get("http:/abc/posts/get");
  2. if (response.statusCode == 200) {
  3. list = json.decode(response.body) as List;
  4. firstList = json.decode(response.body) as List;
  5. setState(() {
  6. isLoading = false;
  7. });
  8. } else {
  9. Toast.show('Failed to load data', context);
  10. throw Exception('Failed to load data');
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement