You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of cubit.state.status.isInProgress || cubit.state.status.isSuccess it would be much easier to write cubit.state.status.isInProgressOrSuccess.
Including myself I only check FormzSubmissionStatusX.isInProgress which can lead to unexpetcted behaviour since in case of succes emit(state.copyWith(status: FormzSubmissionStatus.success)); the ElevatedButton will be clickable which can happen since flutter animates the screens in and out or worse when CircularProgressIndicator is used in case of isInProgress which will be visible for some frames. (Usually when staus becomes succes then form page is closed and still visible while page fades away)
When developer tries to write isI or progr then IDE's autocomplete will show isInProgressOrSuccess along side isInProgress and they will read the docs or just read the changelog.
Note: this proposal should be aplied to 0.5.0-dev.1 I hope it will make to stable version since #48 refactor is awesome and logical.
The text was updated successfully, but these errors were encountered:
the ElevatedButton will be clickable which can happen since flutter animates the screens in and out
This might not be true: flutter/flutter#4770
However ElevatedButton will be showed as enabled instead of disabled while changing pages or CircularProgressIndicator will be on screen.
Use case
In many cases this is the flow in
cubit
/bloc
when operating with form inputs:And this happens on
UI
:Proposal
Instead of
cubit.state.status.isInProgress || cubit.state.status.isSuccess
it would be much easier to writecubit.state.status.isInProgressOrSuccess
.Including myself I only check
FormzSubmissionStatusX.isInProgress
which can lead to unexpetcted behaviour since in case of succesemit(state.copyWith(status: FormzSubmissionStatus.success));
theElevatedButton
will be clickable which can happen since flutter animates the screens in and out or worse whenCircularProgressIndicator
is used in case ofisInProgress
which will be visible for some frames. (Usually when staus becomes succes then form page is closed and still visible while page fades away)When developer tries to write
isI
orprogr
then IDE's autocomplete will showisInProgressOrSuccess
along sideisInProgress
and they will read the docs or just read the changelog.Note: this proposal should be aplied to
0.5.0-dev.1
I hope it will make to stable version since #48 refactor is awesome and logical.The text was updated successfully, but these errors were encountered: