Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final response = await http.get("http:/abc/posts/get");
- if (response.statusCode == 200) {
- list = json.decode(response.body) as List;
- firstList = json.decode(response.body) as List;
- setState(() {
- isLoading = false;
- });
- } else {
- Toast.show('Failed to load data', context);
- throw Exception('Failed to load data');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement