handleSubmit method
Submits form using the current values and calls onSubmit, modifies status based on the result.
Implementation
Future<void> handleSubmit() async {
status = LoStatus.loading;
notifyListeners();
final result = await onSubmit?.call(fields.getValues(), setErrors);
// When no result is returned, means the form became invalid
if (result != null) {
status = result ? LoStatus.success : LoStatus.failure;
}
notifyListeners();
}