강의

멘토링

커뮤니티

Inflearn Community Q&A

yoonho56841161's profile image
yoonho56841161

asked

Create a Quiz App/Server in 1 Hour with Flutter and Django [Full Stack]

Finishing the app by connecting API to Flutter

http.get 타입 문제

Written on

·

316

0

final response =
        await http.get('https://drf-quiz-test.herokuapp.com/quiz/3/');
The argument type 'String' can't be assigned to the parameter type 'Uri'.
해당 오류를 도저히 해결할 수 가 없는데, 혹시 아시는 분 있나요..
djangoFlutter

Answer 2

3

업데이트가 되면서 http.get 메소드의 arg가 바뀐거 같습니다.

Uri 로 넣어주게 바뀐거 같네요. Uri타입으로 넣어주시면 됩니다.

Uri.parse('https://drf-quiz-test.herokuapp.com/quiz/3/')

를 기존 String 대신 넣어주시면 됩니다.

final response = await http.get(Uri.parse('https://drf-quiz-test.herokuapp.com/quiz/3/'));

로 변경하시면 됩니다.

0

yoonho56841161님의 프로필 이미지
yoonho56841161
Questioner

http 패키지 버전이 업그레이드되면서 

생긴 문제였습니다

저는 그냥 http: 0.12.2로 downgrade했습니다

yoonho56841161's profile image
yoonho56841161

asked

Ask a question