Constructor constructor

Constructor({
  1. required String className,
  2. String? constructorName,
  3. Parameter? param,
  4. String modifier = '',
  5. List<IExpression>? statements,
  6. Argument? superArgument,
})

Example

Constructor(
  className: 'Bird',
  constructorName: 'fromName',
  param: Parameter(ParameterItem('this.name', isNamed: true, isRequired: true)),
  superArgument: Argument([MapEntry(null, 'name')]),
  statements: [
    Call('initialize', argument: Argument([MapEntry(null, '5')]))
  ]
)

Output: Bird.fromName({required this.name}) : super(name) { initialize(5); }

Implementation

Constructor(
    {required this.className,
    this.constructorName,
    this.param,
    this.modifier = '',
    this.statements,
    this.superArgument});