The current Travis script will only print offending files, but won’t fail the build. Added `--set-exit-if-changed` to fix that.
Also, simplified the call from using `grep` and `xargs` to simple `flutter format .`, which recurses directories.
Lastly, fixed offending files that needed `dartfmt`. (But not in the directories that aren’t covered by `travis_script.sh`.
After this change, we’re managing Counter’s lifecycle with ChangeNotifierProvider.
This removes the periodic Timer. Not only does that simplify the example and makes it closer to the original, it also prevents a leaking timer (though, in this case, it’s not an issue, since the timer is needed for the whole duration of the app). I experimented with a more robust approach (having or injecting a Timer/StreamController into the Counter, and disposing of it there) but that seemed overly complex for such a simple example. This whole problem will get significantly easier with https://github.com/rrousselGit/provider/issues/46, at which point I could reintroduce this. I will also think about a more complex Provider example, something like the venerable `bloc_complex`, with infinite-scrolling pagination and all that.
I used `flutter create` anew, so the project structure now has additional 2 `AndroidManifest.xml` files. Everything else stayed the same, so from git’s perspective, it’s just moved files.
This is the minimal possible change. It is meant to be readable as a standalone Pull Request.
This does not touch comments. Additionally, it doesn’t use the niceties of provider, like automatic disposal of the model. Lastly, it doesn’t even rename the project from `scoped_model_counter`. All that will come in a follow-up PR.
Adds sample app that mimics the beloved starter app, but with ScopedModel for state management.
Contains a smoke test and is set up to run it in travis_script.sh.