read method

  1. @override
HighlightMenuButton read(
  1. BinaryReader reader
)
override

Is called when a value has to be decoded.

Implementation

@override
HighlightMenuButton read(BinaryReader reader) {
  final numOfFields = reader.readByte();
  final fields = <int, dynamic>{
    for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
  };
  return HighlightMenuButton(
    type: fields[1] as highlight_type,
    label: fields[2] as String,
    colorIntValue: fields[0] as int,
  );
}