pack method

  1. @override
int pack(
  1. Builder fbBuilder
)
override

Serialize the object using the given builder, returning the offset.

Implementation

@override
int pack(fb.Builder fbBuilder) {
  final int? nameOffset = name == null ? null
      : fbBuilder.writeString(name!);
  final int? channelsOffset = channels == null ? null
      : fbBuilder.writeList(channels!.map((b) => b.pack(fbBuilder)).toList());
  fbBuilder.startTable(2);
  fbBuilder.addOffset(0, nameOffset);
  fbBuilder.addOffset(1, channelsOffset);
  return fbBuilder.endTable();
}