input2 method

Future<({String first, String second})?> input2(
  1. HareEdit edit,
  2. HareEdit secondEdit, {
  3. required String title,
  4. String? message,
  5. TextValidator? validator,
  6. TextValidator? secondValidator,
})

Implementation

Future<({String first, String second})?> input2(
  HareEdit edit,
  HareEdit secondEdit, {
  required String title,
  String? message,
  TextValidator? validator,
  TextValidator? secondValidator,
}) async {
  GlobalKey<FormState> formKey = GlobalKey();
  return showColumn(
    onContent: (uc) {
      uc.onValidate = () {
        if (formKey.currentState?.validate() != true) return false;
        if (!edit.validate(validator)) return false;
        if (!secondEdit.validate(secondValidator)) return false;
        String s = edit.value;
        String s2 = secondEdit.value;
        uc.setResult((first: s, second: s2));
        return true;
      };
      return Form(key: formKey, child: ColumnMinStretch([if (message != null) messageWidget(message), edit, secondEdit]));
    },
    title: title,
    ok: true,
    cancel: true,
  );
}