http 통신을 통한 JSON 파싱하기
·
Flutter
pubspce.yaml 의 dependency 에 입력해준다. http: ^0.13.3​ http 패키지 사용을 위해 import 해준다. as http 를 사용하게 되면 http.Response response = await http.get(Uri.parse('주소')); 와 같은 프리픽스를 붙여주여 더욱 명확하게 사용할 수 있다. import 'package:http/http.dart' as http; async 를 사용하는데 그 이유는 http의 get() 함수가 await를 포함하고 있어 비동기가 되기 때문이다. void fetchData() async { try { http.Response response = await http.get( Uri.parse( 'https://jsonplacehol..
해니01_15
'플러터json' 태그의 글 목록