parseMaxAge static method

int? parseMaxAge(
  1. Object? value
)

Parses a maxAge value, accepting an int or a String.

Implementation

static int? parseMaxAge(Object? value) {
  if (value == null) return null;
  if (value is int) return value;
  if (value is num) return value.toInt();
  return int.tryParse(value.toString().trim());
}