FirebaseFirestore.instance.collection('products').doc('L1g7FpTJ4JxNyasTbTF7').get().then((doc) { price = doc.data()['price'].toString(); this.title = doc.data()['name'].toString(); }); code example
Example: get one document based on id in firestore
//retrieve one document and save it to userDetails
const [userDetails, setUserDetails] = useState('')
db.collection('users').doc(id).get()
.then(snapshot => setUserDetails(snapshot.data()))