This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FireStoreDataBase { | |
final CollectionReference collectionRef = | |
FirebaseFirestore.instance.collection("Students"); | |
Future getData() async { | |
try { | |
//to get data from a single/particular document alone. | |
var temp = await collectionRef.doc("<your document ID here>").get(); | |
return temp; | |
} catch (e) { | |
debugPrint("Error - $e"); | |
return null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment