mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
* Make FlutterStandardCodec handle writing NSData iOS developers can accidentally pass an `NSData` object directly to `FlutterStandardCodec` and forget to wrap it in `FlutterStandardTypedData`. This failure won't be caught until runtime. Let's make `FlutterStandardCodec` more tolerant by making it assume that `NSData` should be treated as a binary blob and by wrapping it automatically. Fixes https://github.com/flutter/flutter/issues/17449 Testing Done: * Made a sample Flutter iOS application that created a `FlutterMethodChannel` and invoked a method using an `NSData*` argument. Verified that the Flutter method handler received the message and that the `MethodCall.arguments` was a `UInt8Array` that preserved the original byte order. * Verified that without this change, the same sample application crashed when run in debug mode. * Add a unit test for encoding raw NSData * Formatting adjustments