Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s0punk/flutter_fit_utils_config
Configuration utilities for Flutter apps.
https://github.com/s0punk/flutter_fit_utils_config
configuration-management firebase flutter
Last synced: about 1 month ago
JSON representation
Configuration utilities for Flutter apps.
- Host: GitHub
- URL: https://github.com/s0punk/flutter_fit_utils_config
- Owner: s0punk
- License: other
- Created: 2024-05-20T22:28:57.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-22T01:00:51.000Z (6 months ago)
- Last Synced: 2024-05-23T01:47:50.713Z (6 months ago)
- Topics: configuration-management, firebase, flutter
- Language: Dart
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
A flutter package to easily manage configurations. This package is part of the flutter_fit_utils environement.
![flutter_fit_utils drawio](https://github.com/s0punk/flutter_fit_utils_provider/assets/59456672/74b056f7-f85d-4635-891c-fd9feee99cfb)
## Features
Use this package to:
- Get uniform classes for your different configurations
- Create configurations issued from Firebase Remote Config## Getting started
- Go inside your pubspec.yaml file
- Add this line under the dependencies:
```
flutter_fit_utils_config: ^1.0.0
```
- Get dependencies
```
flutter pub get
```## Usage
To read values from your Firebase Remote Config, simply create a class that extends RemoteConfig:
```dart
/// Example config class.
class CharacterConfig extends RemoteConfig {
int speed = 0;
int attack = 0;@override
void read() {
speed = appConfig.getInt("speed");
attack = appConfig.getInt("attack");
}
}
```To read your configuration, simply call initialize():
```dart
final CharacterConfig characterConfig = CharacterConfig();
await characterConfig.initialize();
```Note that all RemoteConfig share the same FirebaseRemoteConfig instance. So once initialized is called on ANY RemoteConfig instance,
you don't have to call it again for other instances:
```dart
final CharacterConfig characterConfig = CharacterConfig();
await characterConfig.initialize();final CharacterConfig otherConfig = CharacterConfig();
otherConfig.read();
```For the instances that don't call initialize(), make sure to call read() instead.
## Additional information
Feel free to [give any feedback](https://github.com/s0punk/flutter_fit_utils_config/issues) ! This package is also open to contributions.