ofType9<T1, T2, T3, T4, T5, T6, T7, T8, T9> method
Returns all elements in the iterable that are castable to one of the specified types.
After applying ofType9 to an iterable, the resulting iterable will
consist of all elements in the source iterable that can be safely cast
to T1
, T2
, T3
, T4
, T5
, T6
, T7
, T8
or T9
, omitting all elements that cannot.
If all elements in the source iterable can be safely cast to one of the provided types, the resulting iterable will be unchanged.
Implementation
Iterable<T> ofType9<T1, T2, T3, T4, T5, T6, T7, T8, T9>() sync* {
for (var o in this) {
if (o is T1 ||
o is T2 ||
o is T3 ||
o is T4 ||
o is T5 ||
o is T6 ||
o is T7 ||
o is T8 ||
o is T9) {
yield o;
}
}
}