Guest User

Untitled

a guest
Feb 18th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. List returnMovies = [];
  2.  
  3. Future<List> _getData() async {
  4.  
  5. final response = await http.get("https:../getTodayMovies",
  6. headers: {HttpHeaders.AUTHORIZATION: Acess_Token.access_token});
  7.  
  8.  
  9. if (response.body != null) {
  10. returnMovies = json.decode(response.body);
  11. .....
  12.  
  13. setState(() {});
  14. } else {
  15. final responseUpcoming = await http.get("/upcoming",
  16. headers: {HttpHeaders.AUTHORIZATION: Acess_Token.access_token});
  17. returnMovies = json.decode(returnUpcoming.body);
  18.  
  19.  
  20. }
  21.  
  22. returnMovies.addAll(json.decode(returnUpcoming.body))
Add Comment
Please, Sign In to add comment