create method
Implementation
Future<PageModel> create() async {
var htmlComponentId =
constructDocumentId(uniqueId: uniqueId, documentId: pageId);
await htmlWithPlatformMediumRepository(appId: app.documentID)!
.add(HtmlWithPlatformMediumModel(
documentID: htmlComponentId,
appId: app.documentID,
description: 'html 1',
html: '<html><p>$text</p></html>',
conditions: StorageConditionsModel(
privilegeLevelRequired:
PrivilegeLevelRequiredSimple.noPrivilegeRequiredSimple),
));
var page = PageModel(
documentID: constructDocumentId(uniqueId: uniqueId, documentId: pageId),
title: title,
description: description,
appId: app.documentID,
bodyComponents: [
BodyComponentModel(
documentID: "1",
componentName:
AbstractHtmlWithPlatformMediumComponent.componentName,
componentId: htmlComponentId)
],
layout: PageLayout.listView,
appBar: theAppBar,
homeMenu: theHomeMenu,
drawer: leftDrawer,
endDrawer: rightDrawer,
conditions: StorageConditionsModel(
privilegeLevelRequired:
PrivilegeLevelRequiredSimple.noPrivilegeRequiredSimple),
);
await pageRepository(appId: app.documentID)!.add(page);
return page;
}