T? byEnum<T, E>(String key, T Function(String? value) onModel) { if (this[key] == null) return null; return onModel.call(this[key]?.toString()); }