Open stuartmorgan opened 3 months ago
(After filing this I realized that since I explicitly wanted a List
in my use case I could make a helper utility that would convert the NSArray
to a generic List
and then do the rest of the conversions with Dart-idiomatic map
operations, but having that built in to objective_c
, especially for cases where someone just needs an Iterable
and not a List
, would be still be a good quality-of-life improvement.)
This is related to https://github.com/dart-lang/native/issues/1444, but broader in scope.
I wanted to convert some code that was using method channels and did a
map(_helperFunctionToConvertElements)
, and the corresponding code with FFI was a very old-school C-ish style loop-indexes-from-0-to-length-minus-one to manually both convert each element of the array, but also convert theNSArray
to aList
. IfNSArray
supportedIterable
, then it would have been simple and idiomatic to do the conversion to FFI.