input method
Future<String?>
input(
- HareEdit edit, {
- required String title,
- String? message,
- TextValidator? validator,
- double spacing = 8,
Implementation
Future<String?> input(HareEdit edit, {required String title, String? message, TextValidator? validator, double spacing = 8}) async {
GlobalKey<FormState> formKey = GlobalKey();
return showColumn(
onContent: (uc) {
uc.onValidate = () {
if (formKey.currentState?.validate() != true) return false;
if (!edit.validate(validator)) return false;
String s = edit.value;
uc.setResult(s);
return true;
};
return Form(
key: formKey,
child: ColumnMinStretch([if (message != null) messageWidget(message), edit], spacing: spacing),
);
},
title: title,
ok: true,
cancel: true,
);
}