standard_message_codec
0.0.1+5, released 5 months ago by flutter.dev
Binary codec for efficient encoding/decoding of Dart objects without a schema.
What it does
Provides StandardMessageCodec to convert supported Dart objects to a binary format and back. It operates directly on bytes, avoiding UTF‑8 parsing overhead.
AI-written summary of version 0.0.1+5, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need fast, binary message exchange in Flutter/Dart
- Working with dynamic data where a schema like protobuf is unnecessary
Skip it when
- Require built‑in schema validation or versioning
- Need human‑readable payloads such as JSON
Strengths
- High performance binary encoding
- No code generation or schema required
- Cross‑platform support (mobile, web, desktop)
Weaknesses
- No automatic compatibility checks
- Manual responsibility for data structure correctness
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
void main(){final ByteData? data=const StandardMessageCodec().encodeMessage(<Object,Object>{'foo':true,3:'fizz'});print('The encoded message is $data');}Alternatives
Packages that do the same job and could replace standard_message_codec.
- csv_plus
Fast, zero-dependency CSV parser, encoder, streamer, and query engine for Dart.
82Compare - qs_dart
A query string encoding and decoding library for Dart ported from JavaScript's qs.
77Compare - asn1lib
Encodes and decodes ASN.1 objects using BER byte encoding in Dart.
85Compare - emvqrcode
Encode and decode EMVCO QR codes in Dart
50Compare
Works with
Packages commonly used together with standard_message_codec: ones it builds on, ones built on it, and its own family.