resolveFiledName method
String?
resolveFiledName(
- List<
String> fieldsNames, - String fieldName, {
- Map<
String, int> ? fieldsNamesIndexes, - List<
String> ? fieldsNamesLC, - List<
String> ? fieldsNamesSimple, - bool includeAbsentFields = false,
- List<
String> ? returnMapUsedKeys,
inherited
Resolves fieldName
to one that matches a fieldsNames
element.
Implementation
String? resolveFiledName(
List<String> fieldsNames,
final String fieldName, {
Map<String, int>? fieldsNamesIndexes,
List<String>? fieldsNamesLC,
List<String>? fieldsNamesSimple,
bool includeAbsentFields = false,
List<String>? returnMapUsedKeys,
}) {
var f = fieldsNames.firstWhereOrNull((f) => f == fieldName);
f ??= fieldsNames.firstWhereOrNull((f) {
String? fLC, fSimple;
if (fieldsNamesIndexes != null) {
var idx = fieldsNamesIndexes[f]!;
fLC = fieldsNamesLC?[idx];
fSimple = fieldsNamesSimple?[idx];
}
fLC ??= fieldToLCKey(f);
if (fieldName == fLC) return true;
fSimple ??= fieldToSimpleKey(f);
if (fieldName == fSimple) return true;
return false;
});
return f;
}