ProviderSerializableGenerator<Config> constructor

ProviderSerializableGenerator<Config>(
  1. Element element,
  2. ConstantReader reader, {
  3. required String configKey,
})

Implementation

ProviderSerializableGenerator(
  this.element,
  this.reader, {
  required this.configKey,
}) {
  /// Verify the annotated element is a [ClassElement], otherwise throw
  if (element is! ClassElement) {
    final name = element.name;
    throw InvalidGenerationSourceError(
      'Generator cannot target `$name`.',
      todo: 'Please supply a proper class element instead of `$name`.',
      element: element,
    );
  }
}