{"id":17238344,"url":"https://github.com/hoc081098/flutter_provider","last_synced_at":"2026-03-16T12:03:57.016Z","repository":{"id":34408973,"uuid":"178657212","full_name":"hoc081098/flutter_provider","owner":"hoc081098","description":":octocat: Flutter generic provider using InheritedWidget. Flutter generic provider using InheritedWidget. An helper to easily exposes a value using InheritedWidget without having to write one.","archived":false,"fork":false,"pushed_at":"2025-09-19T03:53:36.000Z","size":5021,"stargazers_count":5,"open_issues_count":13,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T12:04:13.935Z","etag":null,"topics":["flutter-provider","inherited-widget","inheritedwidget","provider","provider-flutter","provider-state-management"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_provider","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/hoc081098.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":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-03-31T07:38:45.000Z","updated_at":"2022-11-04T10:41:05.000Z","dependencies_parsed_at":"2023-01-15T06:55:06.776Z","dependency_job_id":"66cafeb9-0378-4038-b10d-558c79b9b5a0","html_url":"https://github.com/hoc081098/flutter_provider","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hoc081098/flutter_provider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoc081098%2Fflutter_provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoc081098%2Fflutter_provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoc081098%2Fflutter_provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoc081098%2Fflutter_provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hoc081098","download_url":"https://codeload.github.com/hoc081098/flutter_provider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hoc081098%2Fflutter_provider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279015053,"owners_count":26085643,"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-10-13T02:00:06.723Z","response_time":61,"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":["flutter-provider","inherited-widget","inheritedwidget","provider","provider-flutter","provider-state-management"],"created_at":"2024-10-15T05:45:18.331Z","updated_at":"2025-10-13T12:09:43.721Z","avatar_url":"https://github.com/hoc081098.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flutter_provider\n\n## Author: [Petrus Nguyễn Thái Học](https://github.com/hoc081098)\n\n\n[![Pub](https://img.shields.io/pub/v/flutter_provider.svg)](https://pub.dartlang.org/packages/flutter_provider)\n[![Build Status](https://travis-ci.org/hoc081098/flutter_provider.svg?branch=master)](https://travis-ci.org/hoc081098/flutter_provider)\n[![codecov](https://codecov.io/gh/hoc081098/flutter_provider/branch/master/graph/badge.svg?token=BG7WmxRnbi)](https://codecov.io/gh/hoc081098/flutter_provider)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fhoc081098%2Fflutter_provider\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false)](https://hits.seeyoufarm.com)\n\n\nFlutter generic provider using InheritedWidget. An helper to easily exposes a value using InheritedWidget without having to write one.\n\n## Getting Started\n\nIn your flutter project, add the dependency to your `pubspec.yaml`\n\n```yaml\ndependencies:\n  ...\n  flutter_provider: \u003clatest_version\u003e\n```\n\n## Usage\n\n### 1. Provide\n\n```dart\nfinal foo = Foo();\nfinal bar1 = Bar1();\n\nProviders(\n  providers: [\n    Provider\u003cBar1\u003e.value(\n      bar1,\n      disposer: (v) =\u003e v.dispose(),\n    ),\n    Provider\u003cBar2\u003e.factory(\n      (context) =\u003e Bar2(),\n      disposer: (v) =\u003e v.dispose(),\n    ),\n  ],\n  child: Provider\u003cFoo\u003e.value(\n    foo,\n    disposer: (v) =\u003e v.dispose(),\n    child: const HomePage(),\n  ),\n);\n```\n\n### 2. Consume\n\n```dart\nProvider.of\u003cT\u003e(context);\ncontext.get\u003cT\u003e();\nConsumer\u003cT\u003e(builder: (context, T value) { });\n```\n\n```dart\nclass HomePage extends StatelessWidget {\n  const HomePage({Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text('Flutter provider example'),\n      ),\n      body: Consumer3\u003cFoo, Bar1, Bar2\u003e(\n        builder: (BuildContext context, Foo a, Bar1 b, Bar2 c) {\n          return Container(\n            constraints: BoxConstraints.expand(),\n            child: Center(\n              child: Column(\n                mainAxisSize: MainAxisSize.max,\n                mainAxisAlignment: MainAxisAlignment.center,\n                crossAxisAlignment: CrossAxisAlignment.center,\n                children: \u003cWidget\u003e[\n                  Text(a.foo()),\n                  Text(b.bar1()),\n                  Text(c.bar2()),\n                ],\n              ),\n            ),\n          );\n        },\n      ),\n    );\n  }\n}\n```\n\n# License\n    MIT License\n    \n    Copyright (c) 2019-2021 Petrus Nguyễn Thái Học\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoc081098%2Fflutter_provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoc081098%2Fflutter_provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoc081098%2Fflutter_provider/lists"}