{"id":19201049,"url":"https://github.com/dabit3/flutter-redux-example","last_synced_at":"2025-11-17T15:14:41.580Z","repository":{"id":73190548,"uuid":"150777149","full_name":"dabit3/flutter-redux-example","owner":"dabit3","description":"Example app using Flutter with Redux including multiple reducers \u0026 initial app state","archived":false,"fork":false,"pushed_at":"2018-10-12T22:49:40.000Z","size":111,"stargazers_count":29,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-09T09:59:00.723Z","etag":null,"topics":["dart","flutter","flutter-dart","redux","redux-dart"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dabit3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-28T18:02:32.000Z","updated_at":"2023-03-01T01:04:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd229452-c0d1-4bd0-93f9-7b404befcffa","html_url":"https://github.com/dabit3/flutter-redux-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dabit3/flutter-redux-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fflutter-redux-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fflutter-redux-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fflutter-redux-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fflutter-redux-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dabit3","download_url":"https://codeload.github.com/dabit3/flutter-redux-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dabit3%2Fflutter-redux-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284905096,"owners_count":27082385,"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","status":"online","status_checked_at":"2025-11-17T02:00:06.431Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","flutter-dart","redux","redux-dart"],"created_at":"2024-11-09T12:36:05.970Z","updated_at":"2025-11-17T15:14:41.556Z","avatar_url":"https://github.com/dabit3.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flutter Redux Example\n\nFlutter example project using redux with multiple reducers \u0026 combineReducers.\n\n## Getting Started\n\nTo get started, clone the project:\n\n```sh\ngit clone https://github.com/dabit3/flutter-redux-example.git\n```\n\n## Redux files\n\n### model.dart\n\n```dart\nimport 'package:flutter/foundation.dart';\n\nclass Item {\n  final int id;\n  final String body;\n\n  Item({\n    @required this.id,\n    @required this.body\n  });\n}\n\nclass AppState {\n  final List\u003cItem\u003e items;\n  final int count;\n\n  AppState({\n    @required this.items,\n    @required this.count,\n  });\n\n  AppState.initialState()\n  : items = List.unmodifiable(\u003cItem\u003e[]),\n    count = 0;\n}\n```\n\n### reducers.dart\n\n```dart\nimport 'package:reduxexample/model.dart';\nimport 'package:reduxexample/redux/actions.dart';\nimport 'package:redux/redux.dart';\n\nenum Actions { Increment }\n\nList \u003cItem\u003e addItemReducer(List\u003cItem\u003e state, action) {\n  return []\n      ..addAll(state)\n      ..add(Item(id: action.id, body: action.item));\n}\n\nList \u003cItem\u003e removeItemReducer(List\u003cItem\u003e state, action) {\n  return List.unmodifiable(List.from(state)..remove(action.item));\n}\n\nList \u003cItem\u003e removeItemsReducer(List\u003cItem\u003e state, action) {\n  return List.unmodifiable([]);\n}\n\nfinal Reducer \u003cList\u003cItem\u003e\u003e itemsReducer = combineReducers \u003cList\u003cItem\u003e\u003e([\n  new TypedReducer\u003cList\u003cItem\u003e, AddItemAction\u003e(addItemReducer),\n  new TypedReducer\u003cList\u003cItem\u003e, RemoveItemAction\u003e(removeItemReducer),\n  new TypedReducer\u003cList\u003cItem\u003e, RemoveItemsAction\u003e(removeItemsReducer),\n]);\n\nint incrementReducer(int state, action) {\n  if (action == Actions.Increment) {\n    return state + 1;\n  }\n  return state;\n}\n\nAppState appStateReducer(AppState state, action) {\n  return AppState(\n    items: itemsReducer(state.items, action),\n    count: incrementReducer(state.count, action),\n  );\n}\n\n```\n\n### Creating the store\n\n```dart\nfinal Store store = Store\u003cAppState\u003e(\n  appStateReducer,\n  initialState: AppState.initialState(),\n);\n\nreturn StoreProvider\u003cAppState\u003e(\n  store: store,\n  child: new MaterialApp(\n    title: 'Flutter App',\n    theme: new ThemeData(\n      primarySwatch: Colors.blue,\n    ),\n    home: MyHomePage()\n  ),\n);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabit3%2Fflutter-redux-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdabit3%2Fflutter-redux-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdabit3%2Fflutter-redux-example/lists"}