{"id":15293110,"url":"https://github.com/configcat/dart-sdk","last_synced_at":"2025-04-13T12:28:34.770Z","repository":{"id":36953137,"uuid":"386555507","full_name":"configcat/dart-sdk","owner":"configcat","description":"ConfigCat SDK for Dart (Flutter). ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.","archived":false,"fork":false,"pushed_at":"2024-11-18T15:33:38.000Z","size":362,"stargazers_count":14,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-13T12:28:33.268Z","etag":null,"topics":["configcat","configcat-sdk","dart","feature-flag","feature-flagging","feature-flags","feature-toggle","feature-toggles","flutter"],"latest_commit_sha":null,"homepage":"https://configcat.com/docs/sdk-reference/dart","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/configcat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-07-16T07:51:17.000Z","updated_at":"2024-11-18T15:33:49.000Z","dependencies_parsed_at":"2023-12-20T12:34:35.042Z","dependency_job_id":"105ea1cd-d5a3-43c3-a8cb-19697b2acd00","html_url":"https://github.com/configcat/dart-sdk","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fdart-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fdart-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fdart-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/configcat%2Fdart-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/configcat","download_url":"https://codeload.github.com/configcat/dart-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248713673,"owners_count":21149744,"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":["configcat","configcat-sdk","dart","feature-flag","feature-flagging","feature-flags","feature-toggle","feature-toggles","flutter"],"created_at":"2024-09-30T16:39:51.146Z","updated_at":"2025-04-13T12:28:34.720Z","avatar_url":"https://github.com/configcat.png","language":"Dart","readme":"# ConfigCat SDK for Dart (Flutter)\n\n[![pub package](https://img.shields.io/pub/v/configcat_client.svg)](https://pub.dev/packages/configcat_client)\n[![Dart CI](https://github.com/configcat/dart-sdk/actions/workflows/dart-ci.yml/badge.svg?branch=main)](https://github.com/configcat/dart-sdk/actions/workflows/dart-ci.yml)\n\nConfigCat SDK for Dart provides easy integration for your application to [ConfigCat](https://configcat.com).\n\n## Getting started\n\n### 1. Install the ConfigCat SDK\nWith Dart:\n```bash\ndart pub add configcat_client\n```\nWith Flutter:\n```bash\nflutter pub add configcat_client\n```\nOr put the following directly to your `pubspec.yml` and run `dart pub get` or `flutter pub get`.\n```yaml\ndependencies:\n  configcat_client: ^4.0.0\n```\n\n### 2. Go to the \u003ca href=\"https://app.configcat.com/sdkkey\" target=\"_blank\"\u003eConfigCat Dashboard\u003c/a\u003e to get your *SDK Key*:\n![SDK-KEY](https://raw.githubusercontent.com/ConfigCat/dart-sdk/master/media/readme02-3.png  \"SDK-KEY\")\n\n### 3. Import the *configcat_client* package in your application code\n```dart\nimport 'package:configcat_client/configcat_client.dart';\n```\n\n### 4. Create a *ConfigCat* client instance\n```dart\nfinal client = ConfigCatClient.get(sdkKey: '#YOUR-SDK-KEY#');\n```\n\n### 5. (Optional) Set up Flutter caching\n\nIf you're using the SDK in a Flutter application, we recommend to use our [Flutter Preferences Cache](https://github.com/configcat/flutter-preferences-cache) for caching. It's based on the [shared_preferences](https://pub.dev/packages/shared_preferences) package.\n\n```dart\nfinal client = ConfigCatClient.get(\n    sdkKey: '#YOUR-SDK-KEY#',\n    options: ConfigCatOptions(cache: ConfigCatPreferencesCache()));\n```\n\n### 6. Get your setting value\n```dart\nfinal isMyAwesomeFeatureEnabled = await client.getValue(key: 'isMyAwesomeFeatureEnabled', defaultValue: false);\nif (isMyAwesomeFeatureEnabled) {\n    doTheNewThing();\n} else {\n    doTheOldThing();\n}\n```\n### 7. Close the client on application exit\n```dart\nclient.close();\n```\n\n## Getting user-specific setting values with Targeting\nUsing this feature, you will be able to get different setting values for different users in your application by passing a `User Object` to the `getValue()` function.\n\nRead more about Targeting [here](https://configcat.com/docs/advanced/targeting/).\n\n\n## User Object\nPercentage and targeted rollouts are calculated by the user object passed to the configuration requests.\nThe user object must be created with a **mandatory** identifier parameter which uniquely identifies each user:\n```dart\nfinal user = ConfigCatUser(identifier: '#USER-IDENTIFIER#');\n\nfinal isMyAwesomeFeatureEnabled = await client.getValue(key: 'isMyAwesomeFeatureEnabled', defaultValue: false, user: user);\nif (isMyAwesomeFeatureEnabled) {\n  doTheNewThing();\n} else {\n  doTheOldThing();\n}\n```\n\n## Sample/Demo app\n* [Sample Console app](https://github.com/ConfigCat/dart-sdk/tree/main/example/lib)\n* [Sample Flutter app](https://github.com/ConfigCat/dart-sdk/tree/main/example/flutter)\n\n## Polling Modes\nThe ConfigCat SDK supports three different polling mechanisms to acquire the setting values from ConfigCat. After the latest setting values are downloaded, they are stored in an internal cache . After that, all requests are served from the cache. Read more about Polling Modes and how to use them at [ConfigCat Dart Docs](https://configcat.com/docs/sdk-reference/dart/).\n\n## Support\nIf you need help using this SDK, feel free to contact the ConfigCat Staff at [https://configcat.com](https://configcat.com). We're happy to help.\n\n## Contributing\nContributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).\n\n## Contributors\nSpecial thanks to [@augustorsouza](https://github.com/augustorsouza), [@miguelspe](https://github.com/miguelspe), and [@mugbug](https://github.com/mugbug) from [@quintoandar](https://github.com/quintoandar) who made available the initial project.\n\n## About ConfigCat\nConfigCat is a feature flag and configuration management service that lets you separate feature releases from code deployments. You can turn features ON/OFF using the \u003ca href=\"http://app.configcat.com\" target=\"_blank\"\u003eConfigCat Dashboard\u003c/a\u003e even after they are deployed. ConfigCat lets you target specific groups of users based on region, email, or any other custom user attribute.\n\nConfigCat is a \u003ca href=\"https://configcat.com\" target=\"_blank\"\u003ehosted feature flag service\u003c/a\u003e that lets you manage feature toggles across frontend, backend, mobile, and desktop apps. \u003ca href=\"https://configcat.com\" target=\"_blank\"\u003eAlternative to LaunchDarkly\u003c/a\u003e. Management app + feature flag SDKs.\n\n- [Official ConfigCat SDKs for other platforms](https://github.com/configcat)\n- [Documentation](https://configcat.com/docs)\n- [Blog](https://configcat.com/blog)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fdart-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconfigcat%2Fdart-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconfigcat%2Fdart-sdk/lists"}