Flutter Engine
FlutterJSONMethodCodec Class Reference

#import <FlutterCodecs.h>

Inheritance diagram for FlutterJSONMethodCodec:

Detailed Description

An arbitrarily large integer value, used with FlutterStandardMessageCodec and FlutterStandardMethodCodec. A codec for method calls and enveloped results.

Method calls are encoded as binary messages with enough structure that the codec can extract a method name NSString and an arguments NSObject, possibly nil. These data items are used to populate a FlutterMethodCall.

Result envelopes are encoded as binary messages with enough structure that the codec can determine whether the result was successful or an error. In the former case, the codec can extract the result NSObject, possibly nil. In the latter case, the codec can extract an error code NSString, a human-readable NSString error message (possibly nil), and a custom error details NSObject, possibly nil. These data items are used to populate a FlutterError. Provides access to a shared instance this codec.

Returns
The shared instance. Encodes the specified method call into binary.
Parameters
methodCallThe method call. The arguments value must be supported by this codec.
Returns
The binary encoding. Decodes the specified method call from binary.
Parameters
methodCallThe method call to decode.
Returns
The decoded method call. Encodes the specified successful result into binary.
Parameters
resultThe result. Must be a value supported by this codec.
Returns
The binary encoding. Encodes the specified error result into binary.
Parameters
errorThe error object. The error details value must be supported by this codec.
Returns
The binary encoding. Deccodes the specified result envelope from binary.
Parameters
envelopeThe error object.
Returns
The result value, if the envelope represented a successful result, or a FlutterError instance, if not. A FlutterMethodCodec using UTF-8 encoded JSON method calls and result envelopes.

This codec is guaranteed to be compatible with the corresponding JSONMethodCodec on the Dart side. These parts of the Flutter SDK are evolved synchronously.

Values supported as methods arguments and result payloads are those supported as top-level or leaf values by FlutterJSONMessageCodec.

Definition at line 444 of file FlutterCodecs.h.


The documentation for this class was generated from the following file: