Skip to content

feat: support Uint8List as FlutterStandardTypedData on iOS#197

Merged
ABausG merged 2 commits into
ABausG:mainfrom
bierbaumtim:main
Mar 8, 2024
Merged

feat: support Uint8List as FlutterStandardTypedData on iOS#197
ABausG merged 2 commits into
ABausG:mainfrom
bierbaumtim:main

Conversation

@bierbaumtim

Copy link
Copy Markdown
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.

@codecov

codecov Bot commented Jan 7, 2024

Copy link
Copy Markdown

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

@ABausG ABausG left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
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
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.

2 participants