createPageEntity static method
Implementation
static Future<PageEntity> createPageEntity(
dynamic page,
String appId,
String homeMenuId,
String leftDrawerDocumentId,
String rightDrawerDocumentId,
String appBarId, {
Feedback? feedback,
}) async {
var documentID = page['documentID'];
page['appId'] = appId;
page['homeMenuId'] = homeMenuId;
page['drawerId'] = leftDrawerDocumentId;
page['endDrawerId'] = rightDrawerDocumentId;
page['appBarId'] = appBarId;
var pageEntity = PageEntity.fromMap(page);
if (pageEntity != null) {
var newPageEntity =
await pageRepository(appId: appId)!.addEntity(documentID, pageEntity);
if (feedback != null) {
feedback(JsonConsts.pages, documentID);
}
return newPageEntity;
} else {
throw Exception('Can not create pageEntity');
}
}