Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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');
```