MessageCodec using the Flutter standard binary encoding.
Supported messages are acyclic values of these forms:
Decoded values will use List<Object?>
and Map<Object?, Object?>
irrespective of content.
The type returned from decodeMessage is dynamic
(not Object?
), which means no type checking is performed on its return value. It is strongly recommended that the return value be immediately cast to a known type to prevent runtime errors due to typos that the type checker could otherwise catch.
The codec is extensible by subclasses overriding writeValue and readValueOfType.
Android specificsOn Android, messages are represented as follows:
java.lang.Boolean
java.lang.Integer
for values that are representable using 32-bit two's complement; java.lang.Long
otherwisejava.lang.Double
java.lang.String
byte[]
int[]
long[]
double[]
java.util.ArrayList
java.util.HashMap
When sending a java.math.BigInteger
from Java, it is converted into a String with the hexadecimal representation of the integer. (The value is tagged as being a big integer; subclasses of this class could be made to support it natively; see the discussion at writeValue.) This codec does not support sending big integers from Dart.
On iOS, messages are represented as follows:
NSNumber numberWithBool:
NSNumber numberWithInt:
for values that are representable using 32-bit two's complement; NSNumber numberWithLong:
otherwiseNSNumber numberWithDouble:
NSString
FlutterStandardTypedData
NSArray
NSDictionary
const
no setterinherited
no setterinherited
message
from binary.
override
message
in binary.
override
inherited
buffer
as written by writeSize.
buffer
as written by writeValue.
type
from buffer
.
inherited
value
to buffer
using an expanding 1-5 byte encoding that optimizes for small values.
value
to buffer
by first writing a type discriminator byte, then the value itself.
inherited
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4