flutter architecture samples
to-do mvc for flutter!
flutter provides a lot of flexibility in deciding how to organize and architect your apps. while this freedom is very valuable, it can also lead to apps with large classes, inconsistent naming schemes, as well as mismatching or missing architectures. these types of issues can make testing, maintaining and extending your apps difficult.
the flutter architecture samples project demonstrates strategies to help solve or avoid these common problems. this project implements the same app using different architectural concepts and tools.
you can use the samples in this project as a learning reference, or as a starting point for creating your own apps. the focus of this project is on demonstrating how to structure your code, design your architecture, and the eventual impact of adopting these patterns on testing and maintaining your app. you can use the techniques demonstrated here in many different ways to build apps. your own particular priorities will impact how you implement the concepts in these projects, so you should not consider these samples to be canonical examples. to ensure the focus is kept on the aims described above, the app uses a simple ui.
current samples
examples have been updated to dart 2.
- lifting state up (vanilla) example – uses the tools flutter provides out of the box to manage app state.
- inheritedwidget example – uses an inheritedwidget to pass app state down the widget hierarchy.
- redux example – uses the redux library to manage app state and update widgets
- built_redux example – uses the built_redux library to enforce immutability and manage app state
- scoped_model example – uses the scoped_model library to hold app state and notify widgets of updates
- firestore redux example – uses the redux library to manage app state and update widgets and adds cloud_firestore as the to-dos database.
- mvu example – uses the dartea library to manage app state and update widgets.
- redurx example – uses the redurx + flutter_redurx libraries as a new way to handle state using rxdart and streambuilder based on a redux store.
supporting code
- integration_tests – demonstrates how to write selenium-style integration (aka end to end) tests using the page object model. this test suite is run against all samples.
- to-dos_repository – demonstrates the repository pattern and testing strategies for working with the filesystem. used to provide local storage and mock web storage to samples.
why a to-do app?
the app in this project aims to be simple enough that you can understand it quickly, but complex enough to showcase difficult design decisions and testing scenarios. for more information, see the app’s specification.
be excellent to each other
this repo is meant as a discussion platform for various architectures. let us debate these ideas vigorously, but let us be excellent to each other in the process!
while healthy debate and contributions are very welcome, trolls are not. read the code of conduct for detailed information.
Comments are closed.