Create method

  1. @override
Future<bool> Create(
  1. IModelRF model,
  2. String docId
)
override

Implementation

@override
Future<bool> Create(IModelRF model, String docId) async {
  String collectionname = model.runtimeType.toString();
  Map<String, dynamic> data = model.getJson();

  try {
    final collection = _db.collection(collectionname);
    collection.doc(docId).set(data);
    return true;
  } catch (e) {
    debugPrint(e.toString());
    return false;
  }
}