인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

DDOLSOON's profile image
DDOLSOON

asked

Flutter Beginner - Http Communication, State Management

Weather의 ws 값이 double 형태가 될때가 있네요.

Written on

·

229

0


as-is
int ws;
ws
= json['ws'];

to-be
double ws;
ws = json['ws'].toDouble();

파싱하다 오류가 나서, 다음과 같이 해결했네요. 다른 수강생 분들도 참고하시면 좋을거같아요~

ios웹앱androidFlutter

Answer 1

0

survivalcoding님의 프로필 이미지
survivalcoding
Instructor

공유 감사합니다. 추가로 int와 double의 상위 타입인 num 타입으로 받는 방법도 있습니다.

num ws;
ws = json['ws']; 

DDOLSOON's profile image
DDOLSOON

asked

Ask a question