init method

dynamic init(
  1. ComponentConstructor chatDashboardComponentConstructorDefault,
  2. ComponentEditorConstructor chatDashboardComponentEditorConstructor
)

Implementation

init(
  ComponentConstructor chatDashboardComponentConstructorDefault,
  ComponentEditorConstructor chatDashboardComponentEditorConstructor,
) {
  Apis.apis().getRegistryApi().addInternalComponents('eliud_pkg_chat_model', [
    "chats",
    "chatDashboards",
    "chatMemberInfos",
    "memberHasChats",
    "rooms",
  ]);

  Apis.apis().getRegistryApi().addDropDownSupporter(
      "chatDashboards", DropdownButtonComponentFactory());
  Apis.apis().getRegistryApi().register(
      componentName: "chatDashboards",
      componentConstructor: chatDashboardComponentConstructorDefault);
  Apis.apis()
      .getRegistryApi()
      .addComponentSpec('eliud_pkg_chat_model', 'chat', [
    ComponentSpec(
        'chatDashboards',
        chatDashboardComponentConstructorDefault,
        ChatDashboardComponentSelector(),
        chatDashboardComponentEditorConstructor,
        ({String? appId}) => chatDashboardRepository(appId: appId)!),
  ]);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_chat_model',
      'chatDashboards',
      ({String? appId}) => chatDashboardRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_chat_model',
      'memberHasChats',
      ({String? appId}) => memberHasChatRepository(appId: appId)!);
  Apis.apis().getRegistryApi().registerRetrieveRepository(
      'eliud_pkg_chat_model',
      'rooms',
      ({String? appId}) => roomRepository(appId: appId)!);
}