I want to create a ‘social foodapp’ for school where you can add a picture, some text
and add it to the feed.
` Future _submitPost() async {
print(‘Submitting post…’);
final FirebaseFirestore db = FirebaseFirestore.instance;
// Voeg de post toe aan de Firestore-collectie "posts"
await db.collection("posts").add({
'text': _postController.text,
'imageData': _imageData,
'timestamp': Timestamp.now(),
}).then((doc) {
print('Post submitted successfully with ID: ${doc.id}');
}).catchError((error) {
print('Error submitting post: $error');
});`
I cannot get past the first errorhandling (‘Submitting post…)
Please help a newbie out
Post a social-media post on the feed. After pushing post it should be in the overview/feed but nothing appears
New contributor
jolynn cuylle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.