tryGetBool method

bool? tryGetBool(
  1. K key, {
  2. List<K>? alternativeKeys,
  3. dynamic innerKey,
  4. int? innerListIndex,
  5. bool? defaultValue,
  6. ElementConverter<bool>? converter,
})

Tries to convert the value at key (or alternativeKeys) to bool.

Implementation

bool? tryGetBool(
  K key, {
  List<K>? alternativeKeys,
  dynamic innerKey,
  int? innerListIndex,
  bool? defaultValue,
  ElementConverter<bool>? converter,
}) => ConvertObjectImpl.tryToBool(
  _firstValueForKeys(key, alternativeKeys: alternativeKeys),
  mapKey: innerKey,
  listIndex: innerListIndex,
  defaultValue: defaultValue,
  converter: converter,
  debugInfo: {
    'key': key,
    if (alternativeKeys != null && alternativeKeys.isNotEmpty)
      'altKeys': alternativeKeys,
  },
);