Returns the ids with type I. See idsAs.
I
List<I> idsNotNullAs<I>() => ids?.whereType<I>().toList() ?? [];