Dart convention is to provide a method toJson() that does this.

See stringify in http://api.dartlang.org/docs/releases/latest/dart_json.html

A benefit of doing this is then this works seamlessly with json.stringify