methodInvocationFromMap method

MethodInvocation<O> methodInvocationFromMap(
  1. Map<String, dynamic> map, {
  2. FieldValueResolver? reviver,
  3. FieldNameResolver? nameResolver,
  4. bool jsonName = false,
})

Creates a MethodInvocation using map entries as parameters.

Implementation

MethodInvocation<O> methodInvocationFromMap(Map<String, dynamic> map,
    {FieldValueResolver? reviver,
    FieldNameResolver? nameResolver,
    bool jsonName = false}) {
  if (jsonName) {
    final fieldsAliases = classReflection.fieldsJsonNameAliases;
    final fieldsAliasesReverse = classReflection.fieldsJsonNameAliasesReverse;

    return methodInvocation((p, i) => _parameterResolverJsonAlias(p, i, map,
        nameResolver, reviver, fieldsAliases, fieldsAliasesReverse));
  } else {
    return methodInvocation(
        (p, i) => _parameterResolver(p, i, map, nameResolver, reviver));
  }
}