preRun method

  1. @protected
Future<bool> preRun(
  1. BuildContext context,
  2. Map actionProps
)

An initial run of validations upon starting a run. E.g.: form validation.

Implementation

@protected
Future<bool> preRun(BuildContext context, Map actionProps) async {
  try {
    final form =
        LowderScreen.of(context)?.formKey.currentState ?? Form.of(context);
    form.save();
    if (parseBool(actionProps["validateForm"]) && !form.validate()) {
      return false;
    }
  } catch (e) {
    // log("[$runtimeType] Form not found.");
  }
  return true;
}