decode<T> abstract method

T decode<T>(
  1. Uint8List bytes,
  2. dynamic decoder
)

Decode bytes to generic typed object.

You need to pass constructor tearoffs for your type in decoder parameter. https://github.com/dart-lang/language/blob/main/accepted/2.15/constructor-tearoffs/feature-specification.md

Example of using fromJson that accepts Map to constuct Person instance:

Person personFromBytes = jsonMessageAdapter.decode(bytes, Person.fromJson);

Implementation

T decode<T>(Uint8List bytes, dynamic decoder);