Skip to content

Commit

Permalink
_TypeWrapperIterable.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpassos committed Nov 8, 2024
1 parent 0b4ab29 commit 751e0fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/reflection_factory_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1037,8 +1037,12 @@ class _TypeWrapperIterable extends _TypeWrapperCollection {
if (value is Iterable<A>) {
return value as V?;
} else if (value is Iterable) {
var elementParser = typeInfo.argumentParser<A>(0)!;
return value.map(elementParser) as V?;
var elementParser = typeInfo.argumentParser<A>(0);
if (elementParser != null) {
return value.map(elementParser).whereType<A>() as V?;
} else {
return value.whereType<A>() as V?;
}
} else {
return TypeParser.parseList<A>(value,
elementParser: typeInfo.argumentParser(0)) as V?;
Expand Down

0 comments on commit 751e0fa

Please sign in to comment.