title: Dart json serialization, how to deal with _id from mongodb being private in Dart?
body: <p>I'm using automatic serialization/deserialization in dart like mentioned <a href="https://flutter.dev/docs/development/data-and-backend/json#creating-model-classes-the-json_serializable-way" rel="nofollow noreferrer">here</a></p>
  
  <pre><code>import 'package:json_annotation/json_annotation.dart';
  
  part 'billing.g.dart';
  
  @JsonSerializable()
  class Billing {
    Billing(){}
    String _id;
    String name;
    String status;
    double value;
    String expiration;
    factory Billing.fromJson(Map&lt;String, dynamic&gt; json) =&gt; _$BillingFromJson(json);
    Map&lt;String, dynamic&gt; toJson() =&gt; _$BillingToJson(this);
  }
  </code></pre>
  
  <p>But in order for the serialization/deserialization to work, the fields must be public. However, in Dart, a field with <code>_</code> at the beggining is private. So I can't use <code>_id</code> from mongodb to serialize/deserialize things.</p>
  
  <p>How can I overcome this?</p>