getMaxStalenessSeconds static method

int? getMaxStalenessSeconds(
  1. Map<String, Object>? options
)

Implementation

static int? getMaxStalenessSeconds(Map<String, Object>? options) {
  if (options == null) {
    return null;
  }
  if (options[keyMaxStalenessSecond] != null) {
    if (options[keyMaxStalenessSecond] is! int ||
        options[keyMaxStalenessSecond] as int < 0) {
      throw ArgumentError('maxStalenessSeconds must be a positive integer');
    }
    return options[keyMaxStalenessSecond] as int;
  }
  return null;
}