{"id":13511405,"url":"https://github.com/bizz84/multiple-counters-flutter","last_synced_at":"2025-04-26T07:31:02.375Z","repository":{"id":136549052,"uuid":"137261888","full_name":"bizz84/multiple-counters-flutter","owner":"bizz84","description":"Flutter State Management [ setState ❖ StreamBuilder ❖ scoped_model ❖ redux ]","archived":false,"fork":false,"pushed_at":"2020-09-30T23:06:09.000Z","size":417,"stargazers_count":132,"open_issues_count":3,"forks_count":36,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-26T06:02:29.351Z","etag":null,"topics":["android","asynchronous-programming","dartlang","flutter","ios","state-management","streams"],"latest_commit_sha":null,"homepage":"https://codewithandrea.com/","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bizz84.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-06-13T19:33:59.000Z","updated_at":"2024-09-01T06:50:43.000Z","dependencies_parsed_at":"2024-01-13T19:22:12.543Z","dependency_job_id":"d211bd51-5ded-4590-85aa-4cf1dac0bd1b","html_url":"https://github.com/bizz84/multiple-counters-flutter","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/bizz84%2Fmultiple-counters-flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bizz84%2Fmultiple-counters-flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bizz84%2Fmultiple-counters-flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bizz84%2Fmultiple-counters-flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bizz84","download_url":"https://codeload.github.com/bizz84/multiple-counters-flutter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250953291,"owners_count":21513292,"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":["android","asynchronous-programming","dartlang","flutter","ios","state-management","streams"],"created_at":"2024-08-01T03:00:49.269Z","updated_at":"2025-04-26T07:31:02.006Z","avatar_url":"https://github.com/bizz84.png","language":"Dart","funding_links":[],"categories":["other"],"sub_categories":[],"readme":"## Flutter State Management\n\nThis is a sample app showing four different approaches to managing state in Flutter:\n\n### [`setState`](https://docs.flutter.io/flutter/widgets/State/setState.html) vs [`StreamBuilder`](https://docs.flutter.io/flutter/widgets/StreamBuilder-class.html) vs [`scoped_model`](https://pub.dartlang.org/packages/scoped_model) vs [`redux`](https://pub.dartlang.org/packages/redux)\n\n**Use case: manage multiple counters, synced with Firebase Database.**\n\nWatch my video for a full overview of the differences and tradeoffs between these techniques:\n\n[![](screenshots/poster-state-management.png)](https://youtu.be/HLop7s2sJ7Q)\n\nSupported tasks:\n\n- Show a list of counters\n- Add new counters\n- Increment or decrement existing counters\n- Remove counters (swipe left to dismiss)\n\n## Database\n\nThe app uses Firebase as a source of truth for the state of the counters. This allows the data to be **easily synced** across multiple clients. Realtime Database and Cloud Firestore are both supported (see `database.dart` class).\n\n**NOTE**: For simplicity, the whole database has public read/write access, and counters can't be set per-user. For a production app it would be more appropriate to set user access rules.\n\n## State management\n\nThe same functionality is replicated in four different pages accessible via the bottom navigation bar, using different state management techniques:\n\n* [`setState`](https://docs.flutter.io/flutter/widgets/State/setState.html)\n* [`StreamBuilder`](https://docs.flutter.io/flutter/widgets/StreamBuilder-class.html)\n* [`scoped_model`](https://pub.dartlang.org/packages/scoped_model)\n* [`redux`](https://pub.dartlang.org/packages/redux)\n\n## Running the project\n\nYou need to register the project with your own Firebase account.\n\n- Use `com.musevisions.multipleCountersFlutter` as your bundle / application ID when generating the Firebase project.\n\n- Download the `ios/Runner/GoogleService-Info.plist` and `android/app/google-services.json` files as needed.\n\n### For more articles and video tutorials, check out [Coding With Flutter](https://codingwithflutter.com/).\n\n### [License: MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbizz84%2Fmultiple-counters-flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbizz84%2Fmultiple-counters-flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbizz84%2Fmultiple-counters-flutter/lists"}