File tree Expand file tree Collapse file tree 4 files changed +15
-20
lines changed Expand file tree Collapse file tree 4 files changed +15
-20
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,10 @@ Take a look at the unit tests to get an idea of how you can use it.
49
49
50
50
----
51
51
52
- ## 2. Experimental : Using reflection to serialize from a real class instance to JSON
52
+ ## 2. Experimental Using reflection to serialize from a real class instance to JSON
53
53
54
54
(Requires use of a the experimental ` mirrors ` branch)
55
55
56
- dependencies:
57
- json_object:
58
- git:
59
- url: git://github.com/chrisbu/dartwatch-JsonObject.git
60
- ref: mirrors
61
56
62
57
Use ` objectToJson(myObj) ` to return a future containing the serialized string.
63
58
Original file line number Diff line number Diff line change 1
- /* (C) 2012 Chris Buckett (chrisbuckett@gmail.com)
1
+ /* (C) 2013 Chris Buckett (chrisbuckett@gmail.com)
2
2
* Released under the MIT licence
3
3
* See LICENCE file
4
4
* http://github.com/chrisbu/dartwatch-JsonObject
Original file line number Diff line number Diff line change 1
1
name : json_object
2
- version : 1.0.11
2
+ version : 1.0.12
3
3
author : Chris Buckett <chrisbuckett@gmail.com>
4
4
description : Allow use of JSON Maps in dot notation format
5
5
homepage : https://github.com/chrisbu/dartwatch-JsonObject
Original file line number Diff line number Diff line change @@ -39,18 +39,18 @@ class _TodoVOImpl extends JsonObject implements TodoVO {
39
39
String toJson () {
40
40
41
41
StringBuffer buffer = new StringBuffer ();
42
- buffer.add ('{' );
43
- buffer.add ('"id":"' ); // add the missing "
44
- buffer.add (id);
45
- buffer.add ('", ' ); // add the missing "
46
-
47
- buffer.add ('"title":"' );
48
- buffer.add ( title );
49
- buffer.add ('", ' );
50
-
51
- buffer.add ('"completed":' );
52
- buffer.add (completed.toString ());
53
- buffer.add ('}' );
42
+ buffer.write ('{' );
43
+ buffer.write ('"id":"' ); // add the missing "
44
+ buffer.write (id);
45
+ buffer.write ('", ' ); // add the missing "
46
+
47
+ buffer.write ('"title":"' );
48
+ buffer.write ( title );
49
+ buffer.write ('", ' );
50
+
51
+ buffer.write ('"completed":' );
52
+ buffer.write (completed.toString ());
53
+ buffer.write ('}' );
54
54
55
55
print (buffer.toString ()); // add a print for debugging
56
56
return buffer.toString ();
You can’t perform that action at this time.
0 commit comments