외부 통신을 통해 JSON 파싱하기
·
Flutter
Future fetchAlbums() async { final uri = Uri.parse('https://jsonplaceholder.typicode.com/albums'); List albumList = []; final response = await http.get(uri); if (response.statusCode == 200) { albumList = json.decode(response.body); return albumList; } else { throw Exception('실패 '); } } @override Widget setBuild() { return FutureBuilder( future: fetchAlbums(), builder: (BuildContext context, Asyn..