ParameterDescriptor constructor

ParameterDescriptor({
  1. required String name,
  2. required Type type,
  3. required List annotations,
  4. bool isNamed = false,
  5. bool isRequired = true,
  6. bool isNullable = false,
  7. dynamic defaultValue,
})

Implementation

ParameterDescriptor({
  required this.name,
  required this.type,
  required this.annotations,
  this.isNamed = false,
  this.isRequired = true,
  this.isNullable = false,
  defaultValue,
}) {
  if ( isRequired && ![String,int,double,bool].contains(type) && !isNullable)
    this.defaultValue = this;
  else
    this.defaultValue = defaultValue;
}