https://github.com/configcat/flutter-preferences-cache
Flutter Cache implementation for ConfigCat Dart (Flutter) SDK.
https://github.com/configcat/flutter-preferences-cache
cache configcat feature-flag feature-flagging feature-flags feature-toggle feature-toggles flutter
Last synced: 11 months ago
JSON representation
Flutter Cache implementation for ConfigCat Dart (Flutter) SDK.
- Host: GitHub
- URL: https://github.com/configcat/flutter-preferences-cache
- Owner: configcat
- License: mit
- Created: 2022-12-09T13:58:57.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T09:31:55.000Z (over 1 year ago)
- Last Synced: 2024-10-23T11:28:57.302Z (over 1 year ago)
- Topics: cache, configcat, feature-flag, feature-flagging, feature-flags, feature-toggle, feature-toggles, flutter
- Language: Dart
- Homepage: https://configcat.com/docs/sdk-reference/dart
- Size: 117 KB
- Stars: 6
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# ConfigCat Flutter Preferences Cache
[](https://pub.dev/packages/configcat_preferences_cache)
[](https://github.com/configcat/flutter-preferences-cache/actions/workflows/flutter-cache-ci.yml)
https://configcat.com
Flutter Cache implementation for [ConfigCat Dart (Flutter) SDK](https://configcat.com/docs/sdk-reference/dart/). It provides caching for Flutter applications on various platforms through [shared_preferences](https://pub.dev/packages/shared_preferences).
Cache storage location by platform:
- **Web**: Browser `LocalStorage`.
- **iOS / macOS**: `NSUserDefaults`.
- **Android**: `SharedPreferences`.
- **Linux**: File in `XDG_DATA_HOME` directory.
- **Windows**: File in roaming `AppData` directory.
## Getting started
### 1. Install the package along with the [ConfigCat Dart (Flutter) SDK](https://configcat.com/docs/sdk-reference/dart/)
```bash
flutter pub add configcat_preferences_cache
flutter pub add configcat_client
```
### 2. Import the *configcat_client* and *configcat_cache* package in your application code
```dart
import 'package:configcat_preferences_cache/configcat_preferences_cache.dart';
import 'package:configcat_client/configcat_client.dart';
```
### 3. Use `ConfigCatPreferencesCache` at the ConfigCat SDK's initialization
```dart
final client = ConfigCatClient.get(
sdkKey: '#YOUR-SDK-KEY#',
options: ConfigCatOptions(cache: ConfigCatPreferencesCache()));
```
## Support
If 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.
## Contributing
Contributions are welcome. For more info please read the [Contribution Guideline](CONTRIBUTING.md).
## About ConfigCat
ConfigCat is a feature flag and configuration management service that lets you separate feature releases from code deployments. You can turn features ON or OFF using the ConfigCat Dashboard even after they are deployed. ConfigCat lets you target specific groups of users based on region, email, or any other custom user attribute.
ConfigCat is a hosted feature flag service that lets you manage feature toggles across frontend, backend, mobile, and desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
- [Official ConfigCat SDKs for other platforms](https://github.com/configcat)
- [Documentation](https://configcat.com/docs)
- [Blog](https://configcat.com/blog)