title: Flutter Firebase - Get a specific field from document
body: <p>I'm trying to get a specific field called "specie" from a document in a Firebase collection. I am trying as follows but I have an error of <em>type 'Future ' is not a subtype of type 'String'</em>. What am I doing wrong?</p>
  
  <p>Repository method:</p>
  
  <pre><code>getSpecie(String petId) {
      Future&lt;DocumentSnapshot&gt; snapshot = petCollection.document(petId).get();
      return snapshot.then((value) =&gt; Pet.fromSnapshot(value).specie);
    }
  </code></pre>
  
  <p>Entity method:</p>
  
  <pre><code> factory Pet.fromSnapshot(DocumentSnapshot snapshot) {
      Pet newPet = Pet.fromJson(snapshot.data);
      newPet.reference = snapshot.reference;
      return newPet;
    }
  
   factory Pet.fromJson(Map&lt;String, dynamic&gt; json) =&gt; _PetFromJson(json);
  
  Pet _PetFromJson(Map&lt;String, dynamic&gt; json) {
    return Pet(json['name'] as String,
        specie: json['specie'] as String);
  }
  </code></pre>