runFunction method

Future runFunction(
  1. BuildContext context,
  2. ActionEntity action
)

Implementation

Future<dynamic> runFunction(BuildContext context, ActionEntity action) async {
  try {
    final controller =
        getVariable(context.pageState, action as PageViewControllerAction);
    if (action is PageViewControllerNextPage) {
      return nextPage(controller);
    } else if (action is CMSUpdateAction) {
      return previousPage(controller);
    }
  } catch (e) {
    context.read<AppLogsCubit>().onNewLog(
          EditorLogEntity(
            id: _uuid.v1(),
            content: e.toString(),
            createdAt: DateTime.now(),
          ),
        );
  }
  return;
}