We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project Name triple
Is your feature request related to a problem? Please describe.
Suggestion for assigning a message when the state changes. With this, it is possible to simply display a snackbar when the state changes.
my controller:
class PersonController extends Store<List<PersonEntity>> { //....Use Cases //....Constructor //....Variables Future insert() async { //..... //Insert person in list setMessage('Person inserted successfully'); update(persons); } Future update() async { //..... //Update person list setMessage('Person updateded successfully'); update(clientes); } Future delete() async { //..... //Remove person from list setMessage('Person deleted successfully') update(persons); } }
observer on my page:
controller.observer( onLoading: (loading) => onLoading(loading), onError: (error) => showError(error.message), onState: (state, message) => onState(state, message) ); void onState(state, message) { //Implements; showMessage(message), }
A second suggestion:
Exemplo:
Controller:
Future update() async { setLoading(true); final result = await _updatePersonUseCase(person: personEntity); result.fold( (success) { persons.add(personEntity); update(persons); setMessage(PersonUpdatedEvent('Person updateded successfully')); }, (failure) => setMessage(failure) ); setLoading(false); }
Page:
controller.observer( onLoading: (loading) => onLoading(loading), onMessage: (message) => onMessage(message), onState: (state) => print(state) ); void onMessage(message) { if(message is PersonUpdatedEvent) { showSucess(message.message); } if(message is PersonException) { showError(message.message); } }
Note: It is possible to show error or success messages using the onError property, but it is conditioned more on errors.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Project Name
triple
Is your feature request related to a problem? Please describe.
Suggestion for assigning a message when the state changes. With this, it is possible to simply display a snackbar when the state changes.
my controller:
observer on my page:
A second suggestion:
Message can be used as error messages or success messages.
Exemplo:
Controller:
Page:
Note: It is possible to show error or success messages using the onError property, but it is conditioned more on errors.
The text was updated successfully, but these errors were encountered: