Json_serializable.dart: How to handle Uint8List type ?

Created on 1 Apr 2019  Â·  2Comments  Â·  Source: google/json_serializable.dart

Hi,

I try to use the json_serializable package to convert Uint8List (byte[]) in JSON but I have this error message :

Error running JsonSerializableGenerator
Could not generate fromJson code for imageContent.
None of the provided TypeHelper instances support the defined type.
â•·
27 │ Uint8List imageContent;
│ ^^^^^^^^^^^^
╵

Here is the source code :

@JsonKey(name: 'image_content')
Uint8List imageContent;

Could you please tell me how to handle the Uint8List type with your package ?

Thanks a lot

All 2 comments

I'm likely NOT going to add support for these types.

Was this page helpful?
0 / 5 - 0 ratings