decode method
TypeDef
decode(
- Input input
)
override
Implementation
@override
TypeDef decode(Input input) {
final index = U8Codec.codec.decode(input);
switch (index) {
case 0:
{
return $TypeDefCompositeCodec._().decode(input);
}
case 1:
{
return $TypeDefVariantCodec._().decode(input);
}
case 2:
{
return $TypeDefSequenceCodec._().decode(input);
}
case 3:
{
return $TypeDefArrayCodec._().decode(input);
}
case 4:
{
return $TypeDefTupleCodec._().decode(input);
}
case 5:
{
return $TypeDefPrimitiveCodec._().decode(input);
}
case 6:
{
return $TypeDefCompactCodec._().decode(input);
}
case 7:
{
return $TypeDefBitSequenceCodec._().decode(input);
}
default:
throw Exception('Unknown type definition variant $index');
}
}