finish method

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

Finish building, and store into the fbBuilder.

Implementation

@override
int finish(fb.Builder fbBuilder) {
  final int? nameOffset = _name == null ? null
      : fbBuilder.writeString(_name!);
  final int? childrenOffset = _children == null ? null
      : fbBuilder.writeListInt32(_children!);
  final int? meshPrimitivesOffset = _meshPrimitives == null ? null
      : fbBuilder.writeList(_meshPrimitives!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
  final int? skinOffset = _skin?.getOrCreateOffset(fbBuilder);
  fbBuilder.startTable(5);
  fbBuilder.addOffset(0, nameOffset);
  fbBuilder.addOffset(1, childrenOffset);
  if (_transform != null) {
    fbBuilder.addStruct(2, _transform!.finish(fbBuilder));
  }
  fbBuilder.addOffset(3, meshPrimitivesOffset);
  fbBuilder.addOffset(4, skinOffset);
  return fbBuilder.endTable();
}