toDocument method

  1. @override
Map<String, Object?> toDocument()
override

Implementation

@override
Map<String, Object?> toDocument() {
  final List<Map<String?, dynamic>>? menuItemsListMap = menuItems != null
      ? menuItems!.map((item) => item.toDocument()).toList()
      : null;

  Map<String, Object?> theDocument = HashMap();
  if (appId != null) {
    theDocument["appId"] = appId;
  } else {
    theDocument["appId"] = null;
  }
  if (name != null) {
    theDocument["name"] = name;
  } else {
    theDocument["name"] = null;
  }
  if (menuItems != null) {
    theDocument["menuItems"] = menuItemsListMap;
  } else {
    theDocument["menuItems"] = null;
  }
  if (admin != null) {
    theDocument["admin"] = admin;
  } else {
    theDocument["admin"] = null;
  }
  return theDocument;
}