Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support Uint8List as FlutterStandardTypedData on iOS #197

Merged
merged 2 commits into from Mar 8, 2024

Conversation

bierbaumtim
Copy link
Contributor

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.

Copy link

codecov bot commented Jan 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (daea9c1) 100.00% compared to head (10c05c8) 100.00%.

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.
📢 Have feedback on the report? Share it here.

@ABausG ABausG changed the title [iOS] - Add support for FlutterStandardTypedData feat: support Uint8List as FlutterStandardTypedData on iOS Mar 5, 2024
Copy link
Owner

@ABausG ABausG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bierbaumtim
Copy link
Contributor Author

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.

@ABausG ABausG merged commit cba8262 into ABausG:main Mar 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants