Skip to content

type 'List<dynamic>' is not a subtype of type 'List<LocalltemSize>' in type cast #3240

Answered by simolus3
Alvish0407 asked this question in Q&A
Discussion options

You must be logged in to vote

As mentioned here (arguably not visible enough, I'll improve the docs here), type converters don't apply to the fromJson factory by default.

This can easily be fixed by using the JsonTypeConverter class, which is almost identical but signals to drift that the converter should also be applied when serializing to JSON instead of just for the db <-> Dart translation.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Alvish0407
Comment options

@Alvish0407
Comment options

Answer selected by Alvish0407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants