getBestConstructorForMap method

ConstructorReflection<O>? getBestConstructorForMap(
  1. Map<String, Object?> map, {
  2. FieldNameResolver? fieldNameResolver,
  3. FieldValueResolver? fieldValueResolver,
  4. bool allowEmptyConstructors = true,
  5. bool allowOptionalOnlyConstructors = true,
})

Returns the best constructor to instantiate with map entries.

See getBestConstructorsForMap.

Implementation

ConstructorReflection<O>? getBestConstructorForMap(Map<String, Object?> map,
    {FieldNameResolver? fieldNameResolver,
    FieldValueResolver? fieldValueResolver,
    bool allowEmptyConstructors = true,
    bool allowOptionalOnlyConstructors = true}) {
  var constructors = getBestConstructorsForMap(map,
      fieldNameResolver: fieldNameResolver,
      fieldValueResolver: fieldValueResolver,
      allowEmptyConstructors: allowEmptyConstructors,
      allowOptionalOnlyConstructors: allowOptionalOnlyConstructors);
  return constructors.firstOrNull;
}