createClass method

Class createClass()

Returns the class ... { ... } for this generated injector.

Implementation

Class createClass() => Class((b) => b
  ..name = _className
  ..extend = _$Hierarchical
  ..implements.add(_$Injector)
  ..constructors.add(Constructor((b) => b
    ..name = '_'
    ..requiredParameters.add(Parameter((b) => b
      ..name = 'parent'
      ..type = _$Injector))
    ..initializers.add(refer('super').call([refer('parent')]).code)))
  ..methods.addAll(_methodCache)
  ..methods.add(createInjectSelfOptional())
  ..fields.addAll(_fieldCache));