Hello @felangel, I have gone through flutter_bloc with Formz example and found out a weird thing about the package. Why are we using IsSubmitting and then a IsSubmitted? can't we directly use isSubmitted? Can we just yield isSubmitted directly without any delay?
if (state.status.isValidated) {
yield state.copyWith(status: FormzStatus.submissionInProgress);
await Future.delayed(Duration(milliseconds: 300));
yield state.copyWith(status: FormzStatus.submissionSuccess);
}
Hi @jaydangar 馃憢
Thanks for opening an issue!
This is just to illustrate what you might normally do in a real application. In this case you could just yield submissionSuccess but in a real application you would likely make an http request to submit the information the user entered to a backend and await a response which is why it is a two part process (submissionInProgress, submissionSuccess/submissionFailure).
Sorry for the confusion and hope that helps clarify things! 馃憤
@felangel Thanks this clarifies the issue.
Most helpful comment
@felangel Thanks this clarifies the issue.