Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lamnhan066/appwrite_config
Flutter plugin for remote configuration for Appwrite.
https://github.com/lamnhan066/appwrite_config
Last synced: 7 days ago
JSON representation
Flutter plugin for remote configuration for Appwrite.
- Host: GitHub
- URL: https://github.com/lamnhan066/appwrite_config
- Owner: lamnhan066
- License: mit
- Created: 2023-08-19T16:37:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-28T17:08:47.000Z (about 1 year ago)
- Last Synced: 2023-10-28T18:25:17.334Z (about 1 year ago)
- Language: Dart
- Size: 14.6 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
# Appwrite Config
A flutter plugin for remote configuration in Appwrite.
## Usage
``` dart
import 'package:appwrite/appwrite.dart';
import 'package:appwrite_config/appwrite_config.dart';final appwriteHelper = AppwriteHelper.instance;
class AppwriteHelper {
static AppwriteHelper instance = AppwriteHelper._();AppwriteHelper._();
late final Databases databases;
late final AppwriteConfigs configs;void initial() {
Client client = Client();
client.setEndpoint('https://cloud.appwrite.io/v1').setProject('backupr');databases = Databases(client);
configs = AppwriteConfigs(
client: client,
databaseId: 'main',
collectionId: 'configuration',
debugLog: true,
defaultValues: {
'Update.LatestVersion': '1.0.0',
'Setting.MaxDownloadNumber': 50,
'Update.BannedVersion': ['<=1.0.0'],
'Update.OnlyShowDialogWhenBanned': false,
},
);
}Future fetchConfigs() =>
configs.fetch(timeout: const Duration(seconds: 5));
}
```Fetch data:
``` dart
appwriteHelper.initial();
await appwriteHelper.fetch();
```Get data:
``` dart
appwriteHelper.configs.getString('Update.LatestVersion');
```