tryGetMap<K2, V2> method

Map<K2, V2>? tryGetMap<K2, V2>(
  1. int index, {
  2. List<int>? alternativeIndices,
  3. dynamic innerMapKey,
  4. int? innerIndex,
  5. Map<K2, V2>? defaultValue,
  6. ElementConverter<K2>? keyConverter,
  7. ElementConverter<V2>? valueConverter,
})

Tries to convert the element at index (or fallback indices) to a Map of K2 to V2.

Implementation

Map<K2, V2>? tryGetMap<K2, V2>(
  int index, {
  List<int>? alternativeIndices,
  dynamic innerMapKey,
  int? innerIndex,
  Map<K2, V2>? defaultValue,
  ElementConverter<K2>? keyConverter,
  ElementConverter<V2>? valueConverter,
}) => ConvertObjectImpl.tryToMap<K2, V2>(
  _firstForIndices(index, alternativeIndices: alternativeIndices),
  mapKey: innerMapKey,
  listIndex: innerIndex,
  defaultValue: defaultValue,
  keyConverter: keyConverter,
  valueConverter: valueConverter,
  debugInfo: {
    'index': index,
    if (alternativeIndices != null && alternativeIndices.isNotEmpty)
      'altIndexes': alternativeIndices,
  },
);