title: flutter json_serializable tojson does not work properly
body: <p>Im looking into the <a href="https://github.com/dart-lang/json_serializable/blob/master/example/lib/example.g.dart" rel="nofollow noreferrer">Order</a> class example and found that the Item class is not converted to Map.</p>
  
  <pre><code>class Order {
    int count;
    int itemNumber;
    bool isRushed;
    Item item; 
    Map&lt;String, dynamic&gt; toJson() =&gt; _$OrderToJson(this);
  }
  </code></pre>
  
  <p>The generated .g file has this:</p>
  
  <pre><code>Map&lt;String, dynamic&gt; _$OrderToJson(Order instance) {
    ...
    writeNotNull('item', instance.item);
    ...
    return val;
  }
  </code></pre>
  
  <p>The item in order map is still of Item type, but Im expecting it to be auto converted to Map as well. the generated .g file should has something like this </p>
  
  <pre><code>writeNotNull('item', instance.item.toJson());
  </code></pre>
  
  <p>I don't want to manually add this since it will be overwritten when .g file is regenerated. Why is the json_serializable lib not doing such a simple thing, or am I missing something? thanks.</p>