{"id":32287046,"url":"https://github.com/mstniy/computed_flutter","last_synced_at":"2026-02-23T10:35:40.585Z","repository":{"id":207426190,"uuid":"718811847","full_name":"mstniy/computed_flutter","owner":"mstniy","description":"Reactive state management for Flutter","archived":false,"fork":false,"pushed_at":"2025-03-23T15:04:13.000Z","size":94,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T02:02:55.692Z","etag":null,"topics":["dart","flutter","functional-programming","reactive","state-management"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/computed_flutter","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/mstniy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2023-11-14T21:09:10.000Z","updated_at":"2025-03-30T21:25:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff277d35-4565-4808-9546-ee4650ba34fc","html_url":"https://github.com/mstniy/computed_flutter","commit_stats":{"total_commits":53,"total_committers":1,"mean_commits":53.0,"dds":0.0,"last_synced_commit":"b22aff956e967040019f1b37adbaefbb1a2d92ae"},"previous_names":["mstniy/computed_flutter"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mstniy/computed_flutter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstniy%2Fcomputed_flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstniy%2Fcomputed_flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstniy%2Fcomputed_flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstniy%2Fcomputed_flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mstniy","download_url":"https://codeload.github.com/mstniy/computed_flutter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstniy%2Fcomputed_flutter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29741155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","functional-programming","reactive","state-management"],"created_at":"2025-10-23T02:02:24.213Z","updated_at":"2026-02-23T10:35:40.576Z","avatar_url":"https://github.com/mstniy.png","language":"Dart","readme":"[![Workflow Status](https://github.com/mstniy/computed_flutter/actions/workflows/tests.yml/badge.svg)](https://github.com/mstniy/computed_flutter/actions?query=branch%3Amaster+workflow%3Atests) [![codecov](https://codecov.io/github/mstniy/computed_flutter/graph/badge.svg?token=VVG1YCC1FL)](https://codecov.io/github/mstniy/computed_flutter)\n\nFlutter bindings for [Computed](https://github.com/mstniy/computed.dart).\n\n\u003e [!NOTE]  \n\u003e [Computed](https://github.com/mstniy/computed.dart) has more in-depth documentation and examples about computation-based state management.\n\nComputed Flutter allows you to interface Computed with Flutter-specific functionality, like `Widget`s and `Listenable`s.\n\n## \u003ca name='table-of-contents'\u003e\u003c/a\u003eTable of contents\n\n\u003c!-- vscode-markdown-toc --\u003e\n\n- [Here is how it works](#here-is-how-it-works)\n- [Using Computed with widgets](#using-computed-with-widgets)\n  - [Using `Computed[Stateful]Widget`](#using-`computed[stateful]widget`)\n  - [Using `ComputedFlutter[Stateful]Mixin`](#using-`computedflutter[stateful]mixin`)\n  - [Using `ComputedBuilder`](#using-`computedbuilder`)\n- [Ingesting data sources](#ingesting-data-sources)\n- [Using results of computations](#using-results-of-computations)\n\n\u003c!-- vscode-markdown-toc-config\n\tnumbering=false\n\tautoSave=true\n\t/vscode-markdown-toc-config --\u003e\n\u003c!-- /vscode-markdown-toc --\u003e\n\n## \u003ca name='here-is-how-it-works'\u003e\u003c/a\u003eHere is how it works\n\nAssume you have a data source, like a `ValueListenable` representing some external state:\n\n```\nValueListenable\u003cint\u003e v;\n```\n\nAnd you want your UI to stay in sync with this external state.  \nAssume for the sake of simplicity that you want to display the value of the external state as-is.  \nYou can achieve this with no boilerplate using Computed:\n\n```\nText('${v.use}')\n```\n\nNote that this does not use code generation, nor does it restrict your codebase to have at most one data source per object type.\n\n## \u003ca name='using-computed-with-widgets'\u003e\u003c/a\u003eUsing Computed with widgets\n\nUsing Computed facilities, like `.use` and `.react`, inside the `build` methods of widgets requires Computed to be aware of them.  \nYou can achieve this in several ways:\n\n### \u003ca name='using-`computed[stateful]widget`'\u003e\u003c/a\u003eUsing `Computed[Stateful]Widget`\n\nIf you have a custom widget, extending `StatelessWidget` or `StatefulWidget`, modify them to extend `ComputedWidget` or `ComputedStatefulWidget` instead:\n\n```\nclass MyWidget extends ComputedWidget {\n    @override\n    Widget build() {\n        // This effectively runs as a computation\n        return Text('${v.use}'); // Automatically re-run whenever [v] changes\n    }\n}\n```\n\n### \u003ca name='using-`computedflutter[stateful]mixin`'\u003e\u003c/a\u003eUsing `ComputedFlutter[Stateful]Mixin`\n\nIf you do not want your widgets to extend `Computed[Stateful]Widget`, perhaps for widgets already extending some other class, you can use the mixins:\n\n```\nclass MyWidget extends MyOtherWidget with ComputedFlutterMixin {\n    ...\n}\n\nclass MyStatefulWidget extends MyOtherStatefulWidget with ComputedFlutterStatefulMixin {\n    ...\n}\n```\n\n### \u003ca name='using-`computedbuilder`'\u003e\u003c/a\u003eUsing `ComputedBuilder`\n\nIf you are using a widget whose definition you cannot modify, or wish to limit the scope of reactive widget rebuilds, use `ComputedBuilder`:\n\n```\nComputedBuilder(builder: (ctx) =\u003e\n    ExternalWidget(v.use)\n)\n```\n\n## \u003ca name='ingesting-data-sources'\u003e\u003c/a\u003eIngesting data sources\n\nComputed Flutter supports reactively depending on `ValueListenable`s with `.use`, as with Computed:\n\n```\nValueListenable\u003cint\u003e v;\n\nfinal c = $((){\n    v.use; // Reactively depends on [v]\n});\n```\n\nTo depend on changes to `Listenable`s, you can use `.watch`:\n\n```\nclass MyListenable implements Listenable {\n    int get value =\u003e ...;\n    ...\n}\n\nMyListenable l;\n\nfinal c = $((){\n    l.watch.value; // Reactively depends on [l]\n});\n```\n\n## \u003ca name='using-results-of-computations'\u003e\u003c/a\u003eUsing results of computations\n\nComputed Flutter allows you to turn computations into `Listenable`s and `ValueListenable`s:\n\n```\nfinal c = $(() =\u003e ...); // A computation\n\nc.asListenable; // Returns a [ComputedListenable]\nc.asValueListenable; // Returns a [ValueListenable]\n```\n\nOf course, other ways of using computations as defined by the base Computed package are available. For easy reference, this includes `.use`, `.listen` and `.asStream`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstniy%2Fcomputed_flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmstniy%2Fcomputed_flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstniy%2Fcomputed_flutter/lists"}