Open bitnick10 opened 8 years ago
I personally have no knowledge over the objectToJson
method. @chrisbu wrote that one, so hopefully he can help.
As far as I can understand from the code, the code seems to be made for an older version of dart:mirrors
that had a ClassMirror.getters
property. The pubspec only mentions a minimum sdk version, so maximum, so probably a refactor has happened when around 1.0.
I have no interest in rewriting the code for the mirror-based code. In fact, now that it's broken, it might be better to remove it, that would also benefit JS compile size.
Yeah, I had this same error, so I went through the code. A lot of the mirror-based code in this repository is aimed for older versions of Dart. I didn't want to break the library for current users by changing the underlying code, so I just made my own library that does a similar thing.
So basically, this issue is fixed with thosakwe/json_god. The API is the tiniest bit different, though. Rather than using a JSONObject class, you can serialize/deserialize any Dart type, using the newer mirror API. Examples are in the repo README.md. It works in Dart2JS, too. Just include a @MirrorsUsed()
annotation on your import to 'dart:mirrors'.
I've used it in a few smaller projects, and I think it does the job well for SDK ^1.0.0.
@thosakwe Off topic, but I've got this awesome Chrome extension:
Haha, that's funny. On Mar 11, 2016 9:05 AM, "Steven Roose" notifications@github.com wrote:
@thosakwe https://github.com/thosakwe Off topic, but I've got this awesome Chrome extension https://chrome.google.com/webstore/detail/nicolas-cage/fjgbnnhgejbfgfbofeohlffjlpceejlm?hl=en :
— Reply to this email directly or view it on GitHub https://github.com/chrisbu/dartwatch-JsonObject/issues/40#issuecomment-195378079 .
I'm newbie to dart.I wonder to know is this a bug or my fault. I'm using dart 1.12.1,dartium 1.11.3.0 and Intellij IDEA When I run the sample
I got the error: