toBoolOr method

bool toBoolOr(
  1. bool defaultValue, {
  2. dynamic mapKey,
  3. int? listIndex,
  4. DynamicConverter<bool>? converter,
})

Converts to bool, falling back to defaultValue on failure.

Implementation

bool toBoolOr(
  bool defaultValue, {
  dynamic mapKey,
  int? listIndex,
  DynamicConverter<bool>? converter,
}) =>
    tryToBool(
      mapKey: mapKey,
      listIndex: listIndex,
      defaultValue: defaultValue,
      converter: converter,
    ) ??
    defaultValue;