강의

멘토링

커뮤니티

Inflearn Community Q&A

uxuio5378's profile image
uxuio5378

asked

[Code Factory] [Intermediate] Flutter Real Practice! State Management, Cache Management, Code Generation, GoRouter, Authentication Logic, etc. Essential Skills to Become an Intermediate!

Working with Dio onError Interceptor

DioError 코드 사용 문제

Written on

·

1K

0

선생님 제 Dio버전이 달라서 그런건지 플러터 문제인지

 } on DioError catch (e) {

코드에서 DioError를 사용할 수 없다는 메세지가 뜹니다.//

'DioError' is deprecated and shouldn't be used. Use DioException instead. This will be removed in 6.0.0.
Try replacing the use of the deprecated member with the replacement.

라는 메세지가 뜨며 DioException을 사용하라는 것 같은데

강의버전과 동일한 dio버전으로 내린뒤에 펍겟해도 똑같이

DioError와 DioErrorType에 선이 그어져있어

 // ignore : deprecated_member_use
 } on DioError catch (e) {

위의 주석코드를 입력하게 되면 DioError 코드 에러가 사라집니다. 이렇게 사용해도 상관이 없는지

DioException을 사용해야 하는지 궁금합니다.

 

flutter하이브리드-앱

Answer 1

0

codefactory님의 프로필 이미지
codefactory
Instructor

안녕하세요!

DioException 사용하셔도 괜찮습니다.

버전을 맞춰도 DioError 에러가 나는 이유는 기존에 받아둔 최신버전이 캐싱돼있어서 그렇습니다.

flutter clean 후 다시 pub get 하시면 아마 잘 될겁니다.

감사합니다!

GO님의 프로필 이미지
GO
Questioner

감사합니다 그것마저 캐싱이 될거란 생각을 못했는데

해결되었습니다.

기분상 최신명령어(?)인 DioException으로 진행해보겠습니다.!

uxuio5378's profile image
uxuio5378

asked

Ask a question