key property

String key
final

A configuration key defined in build.yaml which specifies which sources should be used to get config values for the annotated class.

For example, to create an embedded config for a JSON document placed at lib/app_config.json in your application, you would define a key with the file as a source in your build.*.yaml:

targets:
  $default:
    builders:
      embedded_config:
        options:
          app_config: 'lib/app_config.json'

Then, annotate a class with the key set to the one defined in build.*.yaml (in this case app_config):

@EmbeddedConfig('app_config')
abstract class AppConfig { }

Implementation

final String key;