Advertisement
joaopaulofcc

Untitled

Dec 19th, 2020
1,040
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.27 KB | None | 0 0
  1.   Future<Car> f1(String id) async {
  2.     final response = await http.get(join(_url, 'cars/$id'));
  3.  
  4.     if (response.statusCode == 200) {
  5.       return Car.fromMap(jsonDecode(response.body));
  6.     }
  7.     else {
  8.       throw Exception('Erro ao executar função!');
  9.     }
  10.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement