Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast #125

Open
jerlai15 opened this issue Apr 27, 2023 · 2 comments

Comments

@jerlai15
Copy link

Hi,

The API that is caching has a null value and cached is not accepting it:

E/flutter ( 5080): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: type 'Null' is not a subtype of type 'String' in type cast
E/flutter ( 5080): #0 _$CacheObjFromJson (package:dio_http_cache/src/core/obj.g.dart:11:17)
E/flutter ( 5080): #1 new CacheObj.fromJson (package:dio_http_cache/src/core/obj.dart:43:7)
E/flutter ( 5080): #2 DiskCacheStore.getCacheObj (package:dio_http_cache/src/store/store_disk.dart:118:44)
E/flutter ( 5080):
E/flutter ( 5080): #3 CacheManager._pullFromCache (package:dio_http_cache/src/core/manager.dart:32:13)
E/flutter ( 5080):
E/flutter ( 5080): #4 CacheManager.pullFromCacheBeforeMaxAge (package:dio_http_cache/src/core/manager.dart:56:15)
E/flutter ( 5080):
E/flutter ( 5080): #5 DioCacheManager._onRequest (package:dio_http_cache/src/manager_dio.dart:48:33)
E/flutter ( 5080):
E/flutter ( 5080):

Do you have any work around on this?

@TianyongWang
Copy link

TianyongWang commented Apr 27, 2023 via email

@dhaq
Copy link

dhaq commented Jun 19, 2023

@jerlai15 Did you find any solutions? I facing it when response json is large

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants