onPop method

Future<SilentActionResult> onPop(
  1. NodeSpec action,
  2. ActionContext context
)

Implementation

Future<SilentActionResult> onPop(
    NodeSpec action, ActionContext context) async {
  final props = action.props;
  final navigator = Lowder.actions.appNavigator;
  if (!navigator.canPop()) {
    return SilentActionResult(false);
  }

  final value = props["returnValue"];
  navigator.pop(value);

  if (props["returnMessage"] != null && context.buildContext.mounted) {
    Lowder.widgets.showMessage(
      type: props["returnMessageType"] ?? "info",
      message: props["returnMessage"],
    );
  }

  return SilentActionResult(true, returnData: value);
}