categorySave function

Future<String?> categorySave()

Implementation

Future<String?> categorySave() async {
  try{
    var _data = currentCategory.toJson();
    await FirebaseFirestore.instance.collection("category").doc(currentCategory.id).set(_data, SetOptions(merge:true));
  }catch(ex){
    return "categorySave " + ex.toString();
  }
  return null;
}