Json 직렬화 패키지
Json 데이터를 자동으로 직렬화하는 패키지를 설치하고 사용합니다.
Json 자동 직렬화 관련 패키지 설치
dependencies:
#json 직렬화 관련
json_annotation: ^3.0.1
dev_dependencies:
flutter_test:
sdk: flutter
#json 직렬화
build_runner: ^1.10.0
#json 직렬화
json_serializable: ^3.4.1
dependency_overrides:
#json 직렬화
analyzer: '0.39.14'사용법
프로젝트 루트 폴더에서 아래 명령어를 실행하면 *.g.dart 파일이 생성됩니다.
자동 생성 결과

Last updated
Was this helpful?