[오류 발생 위치]
파일 : ....\kakao_flutter_sdk-0.7.1\lib\src\common\kakao_api_exception.g.dart
KakaoApiException $KakaoApiExceptionFromJson(Map<String, dynamic> json) {
return KakaoApiException(
$enumDecode(_$ApiErrorCauseEnumMap, json['code'],
unknownValue: ApiErrorCause.UNKNOWN),
json['msg'] as String,
json['api_type'] as String, <==================================== 오류 발생 지점
(json['required_scopes'] as List).map((e) => e as String).toList(),
(json['allowed_scopes'] as List).map((e) => e as String).toList(),
);
TalkApi를 통해 friend를 가져오는 과정에서 null을 string으로 casting하여 오류가 발생합니다.
[실행코드 ] final friends = await TalkApi.instance.friends();
[오류코드] E/flutter ( 9132): #0 _$KakaoApiExceptionFromJson package:kakao_flutter_sdk/…/common/kakao_api_exception.g.dart:14 E/flutter ( 9132): #1 new KakaoApiException.fromJson package:kakao_flutter_sdk/…/common/kakao_api_exception.dart:28 E/flutter ( 9132): #2 ApiFactory.transformApiError package:kakao_flutter_sdk/…/common/api_factory.dart:80 E/flutter ( 9132): #3 RequiredScopesInterceptor.onError package:kakao_flutter_sdk/…/auth/required_scopes_interceptor.dart:22 E/flutter ( 9132): #4 DioMixin.fetch._errorInterceptorWrapper...
package:dio/src/dio_mixin.dart:557
E/flutter ( 9132): #5 DioMixin.checkIfNeedEnqueue
package:dio/src/dio_mixin.dart:795
E/flutter ( 9132): #6 DioMixin.fetch._errorInterceptorWrapper..
package:dio/src/dio_mixin.dart:555
E/flutter ( 9132): #7 new Future. (dart:async/future.dart:174:37)
E/flutter ( 9132): #8 _rootRun (dart:async/zone.dart:1420:47)
E/flutter ( 9132): #9 _CustomZone.run (dart:async/zone.dart:1328:19)
E/flutter ( 9132): #10 _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
E/flutter ( 9132): #11 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1276:23)
E/flutter ( 9132): #12 _rootRun (dart:async/zone.dart:1428:13)
E/flutter ( 9132): #13 _CustomZone.run (dart:async/zone.dart:1328:19)
E/flutter ( 9132): #14 _CustomZone.bindCallback. (dart:async/zone.dart:1260:23)
E/flutter ( 9132): #15 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
E/flutter ( 9132): #16 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:395:19)
E/flutter ( 9132): #17 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:426:5)
E/flutter ( 9132): #18 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
[오류 발생 위치] 파일 : ....\kakao_flutter_sdk-0.7.1\lib\src\common\kakao_api_exception.g.dart
KakaoApiException $KakaoApiExceptionFromJson(Map<String, dynamic> json) { return KakaoApiException( $enumDecode(_$ApiErrorCauseEnumMap, json['code'], unknownValue: ApiErrorCause.UNKNOWN), json['msg'] as String, json['api_type'] as String, <==================================== 오류 발생 지점 (json['required_scopes'] as List).map((e) => e as String).toList(),
(json['allowed_scopes'] as List).map((e) => e as String).toList(),
);