title: Flutter CloudFirestore adding complex types throws Invalid argument: Instance of 'Team'
body: <p>I have class Match that has a list of other classes of type Team. Upload of new document (Match) to Firestore is only possible if the list is empty. Once there is Team item in the list, attempt to add it to Firestore throws '<strong>Invalid argument: Instance of 'Team'</strong>'. Team class only contains simple fields, no other classes.</p>
  
  <p>Exception is thrown from StandardMessageCodec.writeValue</p>
  
  <p><strong>Update:</strong>
  I am using cloud_firestore: ^0.8.2, and calling </p>
  
  <pre><code>await firestore.collection('matches').document(match.id).setData(match);
  </code></pre>
  
  <p>since there is no other method that would allow for upload other than setData (accepting Map), I have tried for  match.teams (List):</p>
  
  <ol>
  <li>'teams' : teams (List)</li>
  <li>'teams' : encode to json completely (String)</li>
  <li>'teams' : encode individual Team items and add to collection (List)</li>
  </ol>
  
  <p>1st option will fail, second will create a single string document member and third will create an array of strings inside member, none of which is what I want - create an array of team objects inside document</p>