{"id":13471005,"url":"https://github.com/brianegan/flutter_architecture_samples","last_synced_at":"2025-05-14T04:07:28.994Z","repository":{"id":37484645,"uuid":"112027892","full_name":"brianegan/flutter_architecture_samples","owner":"brianegan","description":"TodoMVC for Flutter","archived":false,"fork":false,"pushed_at":"2021-03-06T14:55:42.000Z","size":3696,"stargazers_count":8819,"open_issues_count":46,"forks_count":1718,"subscribers_count":271,"default_branch":"master","last_synced_at":"2025-04-10T22:34:58.503Z","etag":null,"topics":["dart","flutter","redux"],"latest_commit_sha":null,"homepage":"http://fluttersamples.com/","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianegan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-25T19:08:14.000Z","updated_at":"2025-04-10T16:44:10.000Z","dependencies_parsed_at":"2022-07-13T16:44:38.315Z","dependency_job_id":null,"html_url":"https://github.com/brianegan/flutter_architecture_samples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianegan%2Fflutter_architecture_samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianegan%2Fflutter_architecture_samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianegan%2Fflutter_architecture_samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianegan%2Fflutter_architecture_samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianegan","download_url":"https://codeload.github.com/brianegan/flutter_architecture_samples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069060,"owners_count":22009478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","redux"],"created_at":"2024-07-31T16:00:38.397Z","updated_at":"2025-05-14T04:07:28.965Z","avatar_url":"https://github.com/brianegan.png","language":"Dart","funding_links":[],"categories":["Dart","模板","Flutter 程序","Reference Implementations","Templates [🔝](#readme)","Templates"],"sub_categories":["赚钱","推广和盈利","网络服务_其他","Monetization"],"readme":"# flutter_architecture_samples\n\n[![Build Status](https://travis-ci.org/brianegan/flutter_architecture_samples.svg?branch=master)](https://travis-ci.org/brianegan/flutter_architecture_samples)\n[![Build Status](https://api.cirrus-ci.com/github/brianegan/flutter_architecture_samples.svg)](https://cirrus-ci.com/github/brianegan/flutter_architecture_samples)\n[![codecov](https://codecov.io/gh/brianegan/flutter_architecture_samples/branch/master/graph/badge.svg)](https://codecov.io/gh/brianegan/flutter_architecture_samples)\n\n\u003cimg align=\"right\" src=\"assets/todo-list.png\" alt=\"List of Todos Screen\"\u003e\n\n[TodoMVC](http://todomvc.com) for Flutter!\n\nFlutter provides a lot of flexibility in deciding how to organize and architect\nyour apps. While this freedom is very valuable, it can also lead to apps with\nlarge classes, inconsistent naming schemes, as well as mismatching or missing\narchitectures. These types of issues can make testing, maintaining and extending\nyour apps difficult.\n\nThe Flutter Architecture Samples project demonstrates strategies to help solve\nor avoid these common problems. This project implements the same app using\ndifferent architectural concepts and tools.\n\nYou can use the samples in this project as a learning reference, or as a\nstarting point for creating your own apps. The focus of this project is on\ndemonstrating how to structure your code, design your architecture, and the\neventual impact of adopting these patterns on testing and maintaining your app.\nYou can use the techniques demonstrated here in many different ways to build\napps. Your own particular priorities will impact how you implement the concepts\nin these projects, so you should not consider these samples to be canonical\nexamples. To ensure the focus is kept on the aims described above, the app uses\na simple UI.\n\n### Current Samples\n\n- [Vanilla Lifting State Up Example](vanilla) ([Web Demo](https://fas_vanilla.codemagic.app)) - Uses the tools Flutter provides out of the box to manage app state.\n- [InheritedWidget Example](inherited_widget) ([Web Demo](https://fas_inherited_widget.codemagic.app)) - Uses an InheritedWidget to pass app state down the widget hierarchy.\n- [Change Notifier + Provider Example](change_notifier_provider) ([Web Demo](https://fas_change_notifier_provider.codemagic.app)) - Uses the [ChangeNotifier](https://api.flutter.dev/flutter/foundation/ChangeNotifier-class.html) class from Flutter with [provider](https://pub.dev/packages/provider) package now recommended by the Flutter team.\n- [BLoC Example](bloc_flutter) ([Web Demo](https://fas_bloc_flutter.codemagic.app)) - An implementation of the BLoC pattern, which uses Sinks for Inputs and Streams for Outputs\n- [Bloc Library Example](bloc_library) ([Web Demo](https://fas_bloc_library.codemagic.app)) - Uses the [bloc](https://pub.dartlang.org/packages/bloc) and [flutter_bloc](https://pub.dartlang.org/packages/flutter_bloc) libraries to manage app state and update Widgets.\n- [MobX Example](mobx) ([Web Demo](https://fas_mobx.codemagic.app)) - Uses the [MobX](https://pub.dev/packages/mobx) library to manage app state and update widgets using `Observables`, `Actions` and `Reactions`.\n- [Redux Example](redux) ([Web Demo](https://fas_redux.codemagic.app)) - Uses the [Redux](https://pub.dartlang.org/packages/redux) library to manage app state and update Widgets\n- [\"Simple\" BLoC Example](simple_bloc_flutter) ([Web Demo](https://fas_simple_bloc.codemagic.app)) - Similar to the BLoC pattern, but uses Functions for Inputs and Streams for Outputs. Results in far less code compared to standard BLoC.\n- [MVI Example](mvi_flutter) ([Web Demo](https://fas_mvi.codemagic.app)) - Uses the concepts from Cycle.JS and applies them to Flutter.\n- [states_rebuilder Example](states_rebuilder) ([Web Demo](https://fas_states_rebuilder.codemagic.app)) - Uses the [states_rebuilder](https://pub.dev/packages/states_rebuilder) library to manage app state and update Widgets.\n- [built_redux Example](built_redux) - Uses the [built_redux](https://pub.dartlang.org/packages/built_redux) library to enforce immutability and manage app state\n- [scoped_model Example](scoped_model) - Uses the [scoped_model](https://pub.dartlang.org/packages/scoped_model) library to hold app state and notify Widgets of Updates\n- [Firestore Redux Example](firestore_redux) - Uses the [Redux](https://pub.dartlang.org/packages/redux) library to manage app state and update Widgets and\n  adds [Cloud_Firestore](https://firebase.google.com/docs/firestore/) as the Todos database.\n- [MVU Example](mvu) - Uses the [dartea](https://pub.dartlang.org/packages/dartea) library to manage app state and update Widgets.\n- [MVC Example](mvc) - Uses the [MVC](https://pub.dartlang.org/packages/mvc_pattern) library to implement the traditional MVC design pattern.\n- [Frideos Example](frideos_library) - Uses the [Frideos](https://pub.dartlang.org/packages/frideos) library to manage app state and update widgets using streams.\n\n### Supporting Code\n\n- [integration_tests](integration_tests) - Demonstrates how to write\nselenium-style integration (aka end to end) tests using the Page Object Model.\nThis test suite is run against all samples.\n- [todos_repository_core](todos_repository_core) - Defines the core abstract\nclasses for loading and saving data so that storage can be implemented in\nvarious ways, such as file storage or firebase for mobile projects, or\nwindow.localStorage for web projects.\n- [todos_repository_local_storage](todos_repository_local_storage) - Implements\nthe todos repository using the file system, window.localStorage, and\nSharedPreferences as the data source.\n- [firebase_flutter_repository](firebase_flutter_repository) - Implements \nthe todos repository using firestore as the data source.\n- [firebase_rtdb_flutter_repository](firebase_rtdb_flutter_repository) -\nImplements the todos repository using firebase real-time database as the data\nsource.\n\n### Running the samples\n\n#### iOS / Android\n\n```\ncd \u003csample_directory\u003e\nflutter run \n```\n\n#### Web\n\nMake sure you're on Flutter version \"Flutter 1.12.13+hotfix.6 • channel beta\" or\nnewer. Not all samples support web at this time, so please check the sample\ndirectory for a `lib/main_web.dart` file.\n\n```\ncd \u003csample_directory\u003e\nflutter run -d chrome -t lib/main_web.dart\n```\n\n### Why a todo app?\n\nThe app in this project aims to be simple enough that you can understand it\nquickly, but complex enough to showcase difficult design decisions and testing\nscenarios. For more information, see the [app's specification](app_spec.md).\n\n### Be excellent to each other\n\nThis Repo is meant as a discussion platform for various architectures. Let us\ndebate these ideas vigorously, but let us be excellent to each other in the\nprocess!\n\nWhile healthy debate and contributions are very welcome, trolls are not. Read\nthe [code of conduct](code-of-conduct.md) for detailed information.\n\n### Contributing\n\nFeel free to join in the discussion, file issues, and we'd love to have more\nsamples added! Please read the [CONTRIBUTING](CONTRIBUTING.md) file for guidance\n:)\n\n### License\n\nAll code in this repo is MIT licensed.\n\n## Attribution\n\nAll of these ideas and even some of the language are directly influenced by two\nprojects:\n\n- [TodoMVC](http://todomvc.com) - A Todo App implemented in various JS frameworks\n- [Android Architecture Blueprints](https://github.com/googlesamples/android-architecture) - A similar concept, but for Android! The UI and app spec was highly inspired by their example.\n\n## Contributors\n\n- [Brian Egan](https://github.com/brianegan)\n- [Maurice McCabe](https://github.com/mmcc007)\n- [David Marne](https://github.com/davidmarne)\n- [Pascal Welsch](https://github.com/passsy)\n- [Larry King](https://github.com/kinggolf)\n- [Frank Harper](https://github.com/franklinharper)\n- [Pavel Shilyagov](https://github.com/p69)\n- [Leo Cavalcante](https://github.com/leocavalcante)\n- [Greg Perry](https://github.com/AndriousSolutions)\n- [Felix Angelov](https://github.com/felangel)\n- [Francesco Mineo](https://github.com/frideosapps)\n- [Pavan Podila](https://github.com/pavanpodila)\n- [Kushagra Saxena](https://github.com/kush3107)\n- [Shakib Hossain](https://github.com/shakib609)\n- [Mellati Fatah](https://github.com/GIfatahTH)\n\nI'd like to thank all of the folks who have helped write new samples, improve\nthe current implementations, and added documentation! You're amazing! :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianegan%2Fflutter_architecture_samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianegan%2Fflutter_architecture_samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianegan%2Fflutter_architecture_samples/lists"}