createTutorial static method

Future<PageModel> createTutorial(
  1. String appId,
  2. String tutorialID,
  3. String title,
  4. String description,
  5. DrawerModel? drawer,
  6. AppBarModel appBar,
  7. HomeMenuModel? homeMenu,
)

Implementation

static Future<PageModel> createTutorial(
    String appId,
    String tutorialID,
    String title,
    String description,
    DrawerModel? drawer,
    AppBarModel appBar,
    HomeMenuModel? homeMenu) async {
  List<BodyComponentModel> components = [];
  components.add(BodyComponentModel(
      documentID: "1",
      componentName: AbstractTutorialComponent.componentName,
      componentId: tutorialID));
  PageModel page = PageModel(
    documentID: tutorialID,
    appId: appId,
    title: title,
    description: description,
    appBar: appBar,
    drawer: drawer,
    homeMenu: homeMenu,
    bodyComponents: components,
    layout: PageLayout.onlyTheFirstComponent,
    conditions: StorageConditionsModel(
      privilegeLevelRequired:
          PrivilegeLevelRequiredSimple.noPrivilegeRequiredSimple,
    ),
  );
  return await AbstractRepositorySingleton.singleton
      .pageRepository(appId)!
      .add(page);
}