registerActions method

  1. @override
void registerActions()
override

Implementation

@override
void registerActions() {
  registerAction(
      EditorAction.terminationAction, (_, __) => ActionResult(false),
      abstract: true,
      baseType: null,
      properties: {
        "validateForm": Types.bool,
        "silent": Types.bool,
        "confirmation": const EditorPropertyType("KConfirmMessage"),
        "executeCondition": Types.kCondition
      },
      actions: {
        "onFailure": EditorActionType.action()
      });
  registerAction(EditorAction.action, (_, __) => ActionResult(false),
      abstract: true,
      baseType: EditorAction.terminationAction,
      properties: {"returnName": Types.string},
      actions: {"nextAction": EditorActionType.action()});

  registerSilentAction("KActionMessage", onMessage,
      baseType: EditorAction.terminationAction,
      properties: {
        "type": const EditorPropertyListType(
            ["success", "warning", "error", "info"]),
        "message": Types.string
      });

  registerSilentAction("KActionNavigate", onNavigate,
      baseType: EditorAction.terminationAction,
      properties: {
        "jumpToScreen": Types.screen,
        "jumpToRoute": Types.string,
        "replacePrevious": Types.bool,
        "replaceAll": Types.bool,
        "state": Types.json,
        "transition": Types.routeTransitionBuilder,
        "transitionDuration": Types.int
      },
      actions: {
        "onPop": EditorActionType.action()
      });
  registerSilentAction("KActionPop", onPop,
      baseType: EditorAction.terminationAction,
      properties: {
        "returnValue": Types.string,
        "returnMessage": Types.string,
        "returnMessageType": const EditorPropertyListType(
            ["success", "warning", "error", "info"])
      });
  registerSilentAction("KActionShowDialog", onShowDialog,
      baseType: EditorAction.terminationAction,
      properties: {
        "jumpToScreen": Types.screen,
        "jumpToRoute": Types.string,
        "state": Types.json,
        "barrierDismissible": Types.bool,
        "barrierColor": Types.color,
        "backgroundColor": Types.color,
        "padding": Types.intArray,
        "alignment": Types.alignment,
        "elevation": Types.int,
        "transition": Types.routeTransitionBuilder,
        "transitionDuration": Types.int
      },
      actions: {
        "onPop": EditorActionType.action()
      });

  registerSilentAction("BlocState", onBlocState, properties: {
    "name": Types.string,
    "type": const EditorPropertyListType(["local", "global"]),
    "data": Types.json
  });
  registerSilentAction("KActionSetState", onSetState,
      properties: {"newState": Types.json});
  registerSilentAction("KActionSetGlobalVar", onSetGlobalVar,
      properties: {"key": Types.string, "value": Types.string});
  registerSilentAction("KActionIf", onIf,
      baseType: EditorAction.terminationAction,
      properties: {
        "condition": Types.kCondition
      },
      actions: {
        "onTrue": EditorActionType.action(),
        "onFalse": EditorActionType.action()
      });

  registerHttpAction("KActionRequest", onRequest,
      properties: {"request": Types.request});
  registerHttpAction("KActionRest", onRest, properties: {
    "url": Types.string,
    "path": Types.string,
    "method": const EditorPropertyListType(
        ["get", "post", "put", "delete", "patch"]),
    "queryArgs": Types.json,
    "body": Types.json
  });

  registerAction("KActionReload", onReload);
  registerAction("KActionReloadAll", onReloadAll);
  registerAction("SetLanguage", onSetLanguage,
      properties: {"language": Types.string});

  // registerAction("KActionLinkToAction", onLinkToAction, EditorAction(
  //   baseType: EditorAction.terminationAction,
  //   properties: {
  //     "action": const EditorPropertyType(EditorAction.action),
  //   },
  // ));

  registerAction(EditorAction.listAction, (_, __) => ActionResult(false),
      abstract: true, baseType: null);
  registerLoadPageAction("KListActionRequest", onLoadPageRequest,
      properties: {
        "request": Types.request,
        "arrayKey": Types.string,
        "isPaged": Types.bool
      });
  registerLoadPageAction("KListActionRest", onLoadPageRest, properties: {
    "url": Types.string,
    "path": Types.string,
    "method": const EditorPropertyListType(
        ["get", "post", "put", "delete", "patch"]),
    "queryArgs": Types.json,
    "body": Types.json,
    "arrayKey": Types.string,
    "isPaged": Types.bool
  });
  registerLoadPageAction("KListActionData", handleStaticData,
      properties: {"data": Types.json, "shuffle": Types.bool});
  registerAction("ReloadList", onReloadList,
      baseType: EditorAction.action, properties: {"listId": Types.string});
}