-
json 데이터 처리프로그래밍/다트(dart) 2021. 12. 5. 15:25
import 'dart:convert'; void main(){ var jsonString = ''' [ {"name": "철수"}, {"name": "영희"} ] '''; var people = jsonDecode(jsonString); var earlyPerson = people[0]; print(people is List); print(earlyPerson is Map); print("early Pserson name is " + earlyPerson['name']); }
결과
1. true
2. true
3. early Pserson name is 철수
예시 데이터를 jsonDecode를 하게되면 List<Map> 자료형으로 반환된다.