Map key coercion
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; }