remote_config_gen 0.0.1
remote_config_gen: ^0.0.1 copied to clipboard
A tool to generate remote config classes from the remote config template
Remote Config Generator #
A tool to generate Dart classes from Firebase Remote Config templates for type safe and static typing. No more hardcoded values!
Usage #
- Add the dev_dependency
dev_dependencies:
remote_config_gen: 0.0.1
-
Download/Fetch the
remoteconfig.template.json
for your projectfirebase remoteconfig:get -o remoteconfig.template.json
-
Create a
remote_config_gen.yaml
file and define the configuration:input: remoteconfig.template.json output: lib/generated
-
Run the generator
dart run remote_config_gen
-
Use the generated parameters:
import 'package:remote_config_gen/remote_config_gen.dart'; // It will return either the remote value or the default defined in the template int value = RemoteConfigParams.maxRetryCount.getValue(); // It also accepts remote config groups bool isDark = RemoteConfigParams.uiSettings.darkMode.getValue();