insert function

dynamic insert(
  1. dynamic data,
  2. dynamic table
)

Implementation

insert(data, table) async {
  CollectionReference<Map<String, dynamic>> tempString;
  tempString = FirebaseFirestore.instance.collection(table);
  var tempData = await tempString.add(data);
  return tempData.id;
}