restoreFromMap static method
Future<List<String> >
restoreFromMap(
- dynamic theItems,
- RepositoryBase repository,
- String appId, {
- PostProcessing? postProcessing,
- Map<
String, String> ? newDocumentIds,
Implementation
static Future<List<String>> restoreFromMap(
dynamic theItems,
RepositoryBase repository,
String appId, {
PostProcessing? postProcessing,
Map<String, String>? newDocumentIds,
}) async {
List<String> documentIds = [];
if (theItems != null) {
for (var theNewItem in theItems) {
var documentID = renameDoc(theNewItem, newDocumentIds);
if (postProcessing != null) {
postProcessing(theNewItem);
}
EntityBase entity =
repository.fromMap(theNewItem, newDocumentIds: newDocumentIds);
var newEntity = entity.switchAppId(newAppId: appId);
await repository.addEntity(documentID, newEntity);
documentIds.add(documentID);
}
}
return documentIds;
}