inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

176만명의 커뮤니티!! 함께 토론해봐요.

AirResult _result 초기화 에러

미해결

Flutter 초급 - Http통신, 상태관리

1. main.dart 에서 AirResult 를 선언하면 초기화 하라는 에러가 발생합니다. AirResult _result ======================================================= Non-nullable instance field '_result' must be initialized. Try adding an initializer expression, or a generative constructor that initializes it, or mark it 'late'. 초기화 방법에 대한 가이드 부탁드립니다. (late 를 추가해도 미세먼지를 표시하는 부분에서 아래와 같이 에러가 발생합니다.) 2. late 로 바꾸던 바꾸지 않던 아래 볼드 처리된 코드에서도 에러가 발생합니다. 해결방법에 대한 가이드 부탁드립니다. children: <Widget>[ const Text('얼굴사진'), const Text( '${_result.data.current.pollution.aqius}', style: TextStyle(fontSize: 40)), const Text('보통', style: TextStyle(fontSize: 20)), ], ), ============================================================== Evaluation of this constant expression throws an exception. Invalid constant value. 3. 변수 선언을 아래와 같이 시도했지만 해결되지 않습니다. 참고해주세요. 1) late AirResult _result; 2) AirResult? _result;

  • AirResult
  • android
  • ios
  • 웹앱
  • Flutter
에스큐아이소프트교육 댓글 1 좋아요 0 조회수 635

인기 태그

인프런 TOP Writers

주간 인기글