feat: support Uint8List as FlutterStandardTypedData on iOS#197
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #197 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 69 69
=========================================
Hits 69 69 ☔ View full report in Codecov by Sentry. |
ABausG
left a comment
There was a problem hiding this comment.
LGTM - Thank you for this. I have created #230 to also support this on Android. Would you have time to add this for Android?
If not: Please let me know and I can take care of this
If yes: Could you give me a rough estimation of time? If you think you can get it done swiftly (or kotlinly I guess ;) ) I'm happy for you to just add this to this branch
|
Yes I can work on that topic on friday and saturday. I've already looked at how to implement this, but it's not as easy on Android as it is on iOS, but to stay on topic, more on that in #230. |
Thanks for this awesome package.
This PR adds support for Uint8List, Int32List, Int64List, Float64List. The StandardMessageCodec encodes them to FlutterStandardTypedData in Swift. Passing this type of data to UserDefaults.SetValue results in a runtime crash.
I added a special case to extract the data and cast it to the built-in type
Data. With this small change saving the data to UserDefaults completes successfully.