unpackMap method
Automatically unpacks bytes to Map where key and values has corresponding data types.
Return types declared as Object instead of dynamic for safety reasons.
You need explicitly cast to proper types. And in case with Object
compiler checks will force you to do it whereas with dynamic it will not.
Implementation
Map<Object?, Object?> unpackMap() {
final length = unpackMapLength();
return {for (var i = 0; i < length; i++) _unpack(): _unpack()};
}