Varioqub Configs Generator

Helper package for varioqub_configs to generate code based on your defaults.xml
Example of using
1. Go to your AppMetrica project website and download the default values of your configurations


Use the following buttons to download the configuration file. Move it to your project folder.
2. Add this package and varioqub_configs
to your project dependencies
dependencies:
varioqub_configs: ^0.8.1
dev_dependencies:
varioqub_configs_generator: ^0.1.1
3. Use the command to generate the configuration code based on your default values
dart run varioqub_configs_generator --config="path/to/config.xml" --output "lib/src/configs.g.dart"
Example of generated code
For the following configuration the following file will be generated:
<?xml version="1.0" ?>
<defaults client_id="example" config_id="12" config_version="17">
<entry>
<key>string-key</key>
<value>value</value>
</entry>
<entry>
<key>number-key</key>
<value>123</value>
</entry>
</defaults>
// Autogenerated from varioqub_configs_generator (v0.1.1), do not edit directly.
// See also: https://pub.flutter-io.cn/packages/varioqub_configs_generator
import 'package:varioqub_configs/varioqub_configs.dart';
abstract final class VarioqubConfigs {
static const String $clientId = 'example';
static const int $configId = 12;
static const int $configVersion = 17;
static const Map<String, Object> $defaultValues = {
'string-key': 'value',
'number-key': 123,
};
static Future<String> get stringKey async =>
Varioqub.getString(key: 'string-key', defaultValue: 'value');
static Future<int> get numberKey async =>
Varioqub.getInt(key: 'number-key', defaultValue: 123);
}
4. Use generated with variogub_configs
await Varioqub.build(
const VarioqubSettings(
clientId: VarioqubConfigs.$clientId,
activateEvent: true,
logs: true,
trackingWithAppMetrica: true,
fetchThrottleInterval: Duration(hours: 12),
),
);
await Varioqub.setDefaults(VarioqubConfigs.$defaultValues);
await VarioqubConfigs.stringKey; // value
await Varioqub.fetchConfig();
await Varioqub.activateConfig();
await VarioqubConfigs.stringKey; // your-remote-value
Sources
What is Varioqub? (The main website of the Varioqub project)
Changelog
Refer to the Changelog to get all release notes.
Maintainers
This library is open for issues and pull requests. If you have ideas for improvements or bugs, the repository is open to contributions!