addBugs method
- BugModelCustom bugModel
Adds a new bug to Firestore.
Converts the bugModel
to a map,
adds the createdAt
server timestamp,
and sets the createdby
field as the current user's UID.
Implementation
Future<void> addBugs(BugModelCustom bugModel) async {
final data = bugModel.toMap();
data['createdAt'] = FieldValue.serverTimestamp();
data['createdby'] = FirebaseAuth.instance.currentUser!.uid;
await bugcollection.add(data);
}