marcg
marcg

Reputation: 658

json_object and dart:mirror

I am using json_object as in Using Dart with JSON Web Services

Code works fine in Dartium. Upon building using dart_to_js_script_rewriter, warning is thrown.

WARNING: dart:mirrors support in dart2js is experimental, * and not recommended. * This implementation of mirrors is incomplete, * and often greatly increases the size of the generated * JavaScript code. * * Your app imports dart:mirrors via: package:json_object => dart:mirrors

What are the good alternatives to json_object ? I know JSON.decode exists but I would like to avoid the Map API if possible

Upvotes: 4

Views: 330

Answers (1)

Hadrien Lejard
Hadrien Lejard

Reputation: 5924

To work with json, it is now recommended to use code generation if you work on a browser or reflection if you work on the Dart VM.

You can try package like jaguar_serializer that help you convert a JSON string into a Dart Object.

Upvotes: 1

Related Questions