createInstanceWithConstructorByName method

O? createInstanceWithConstructorByName(
  1. String constructorName,
  2. Map<String, dynamic> map, {
  3. FieldNameResolver? fieldNameResolver,
  4. FieldValueResolver? fieldValueResolver,
})

Creates an instance with the constructor with constructorName using map entries as parameters.

Implementation

O? createInstanceWithConstructorByName(
    String constructorName, Map<String, dynamic> map,
    {FieldNameResolver? fieldNameResolver,
    FieldValueResolver? fieldValueResolver}) {
  var constructor = this.constructor(constructorName);

  if (constructor == null) return null;

  return createInstanceWithConstructor(constructor, map,
      fieldNameResolver: fieldNameResolver,
      fieldValueResolver: fieldValueResolver);
}