getEnum<T extends Enum> method
T
getEnum<T extends Enum>(})
Converts the element at index to an enum value using parser.
Implementation
T getEnum<T extends Enum>(
int index, {
required T Function(dynamic) parser,
dynamic innerMapKey,
int? innerIndex,
T? defaultValue,
Map<String, dynamic>? debugInfo,
}) {
final info = <String, dynamic>{};
if (debugInfo != null && debugInfo.isNotEmpty) {
info.addAll(debugInfo);
}
info['index'] = index;
return ConvertObjectImpl.toEnum<T>(
_valueAt(index),
parser: parser,
mapKey: innerMapKey,
listIndex: innerIndex,
defaultValue: defaultValue,
debugInfo: info,
);
}