Skip to content
New issue

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

update states_rebuilder sample to use the latest version and to use immutable state #182

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

GIfatahTH
Copy link
Contributor

@GIfatahTH GIfatahTH commented Apr 30, 2020

This updates the states_rebuilder implementation to use the 1.15.0 version.

Changes:

  • Immutable state: Now Todo and TodosState are immutable objects.
  • methods in TodosState are static pure functions
  • New requirement: I add the requirement that if a todo is added, deleted or updated, the modification is instantly reflected in the UI and the async savaTodos is executed in the background. If the saveTodos fails and throws an error, the last state is restored and a SnackBar containing the error is displayed.
    This requirement does not cost me to add more than a few lines of code for all the possible add, delete, and update.
  • Widget test: almost all the widget behavior is tested. Even the added requirement is tested.

@GIfatahTH
Copy link
Contributor Author

The test fails because :
every version of flutter_test from sdk depends on collection 1.14.11 and states_rebuilder >=2.0.0 depends on collection ^1.14.12, flutter_test from sdk is incompatible with states_rebuilder >=2.0.0.

What does this mean? should I go back to collection 1.14.11?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant