coerceKeyIntOrNull function

int? coerceKeyIntOrNull(
  1. Object? k
)

Map key coercion

Implementation

int? coerceKeyIntOrNull(Object? k) {
  if (k is int) return k;
  if (k is num) return k.toInt();
  if (k is String) return int.tryParse(k);
  return null;
}