Squashed 'third_party/flatbuffers/' changes from 338393f85..e5f331db9

e5f331db9 [TS] Add single-file ts codegen & bazel rule for typescript (#7161)
2f84c6038 Apply Namer to Go code gen (#7150)
d64839651 [Lobster] file_identifier support
777e78d8d [Lobster] support unsigned integer reads
4016c549d Apply Namer to Python code gen (#7146)
40827b21b Fix missing 'break' (#7151)
65a10b6e3 Implement a config based name manager and use it in Rust codegen (#7144)
8db2fef3f [TS] Escape keywords in typescript object names (#7137)
9ed132304 Fix 64-bit numeric enum values in typescript (#7135)
1a4c40566 updated npm to 2.0.6
318594e4b prevent name clash (#7133)
3d903302c [Rust] Add length checks to arrays and vectors. (#7130)
c9571d989 Replaced ToDasherCase with ConvertCase (#7131)
3694b830a Use ConvertCase instead of Make{Upper,Lower,Snake} implementations (#7127)
0471fa807 remove stall reference to version
914344ea9 some minor help edits
b40266c56 Use target_compile_features to target C++11 (#7122)
8a9303d46 update proto tests with alaised enum (#7121)
30c4bf47f Trigger fuzzing CI only on relevant changes (#7120)
46ce45601 remove auto generate code from cmakelists (#7119)
433312c55 add the missing checkNullConditionnal code in the "GenObjApi" function when the field is scalar optional (#7114)
9c52ec374 Add deps attribute to flatbuffer_cc_library (#7107)
70e2f49bf fixed string-json -> strict-json typo
5ac0367ed [TS] Fix generation of reserved words in object api (#7106) (#7115)
5d101afb5 Fix minor typo in WhitePaper.md (#7108)
06f4af11b Go optional scalars (#7104)
57e338f81 explicitly use windows-2019 to unblock ci (#7105)
615616cb5 Change Rust generated file defaults (#7101)
3413c3300 Fixed FlexBuffers verifier fuzzer timing out
69f5660a4 Fixed Parser not checking size of union types vector
d5add9fca Fixed FlexBuffers ToString unquoted non-ident keys
15df50eb7 Remove @ExperimentalUnsignedTypes annotation from kotlin code generator. (#7092)
a94132a45 Swift FlatBufferBuilder.sizedByteArray to ByteBuffer.toArray() (#7093)
48befb6be [TS] Refactor away circular ref (#7099)
b30069133 Add reflection support for python (#7026)
faadbc10e Add CreateVector overload to accept array like (#7095)
ed6ae8d32 explicitly defined std::allocator (#7094)
e910bddbc [JS] Add ".js" suffix to all import statements to generate a browser compatible mjs version. (#7086)
c85fb690f Add Parsing Completed function for Rust (#7084)
c1daa6ba0 rust: Bump thiserror version and remove git dependency (#7080)
4c71c7b02 replace framework include of flatbuffers (#7079)
f5664d33f fix go_test implement error (#7012)
39c8a19ce fixed comparator for native_inline (#7076)
826193ff6 skip generating reflection.fbs in generate_scripts (#7077)
fd0d1ed92 update C++ generator to emit scoped enums in vector of unions (#7075)
424988f30 replaced removed xml tag
b2550dbaa removed BSD-3-Clause license and Zlib licenses (#7073)
a2b238960 Fixed default value of bool in struct for Swift (#7072)
619b78437 one last dart omit local (#7070)
68a766154 more omit type annotations for dart local variables (#7069)
7dac9961f omit type annotations for dart local variables (#7067)
c65c389c6 add xmlns to .Net (#7066)
6446dcf3d Updates swift gen licence for grpc code (#7063)
e090d8da1 Fixed long cast to int in flexbufferbuilder.java (#7059)
bc901436d clang format on codebase (#7058)
240be9b5a attempt to remove appveyor (#7056)
bc366a7f9 Provide a short help text and default in error case (#6992)
14b19d446 Use FindPython3 (#7055)
9e6f17b94 remove BIICODE
c3801ad37 Update readme.md
4f3b24db0 Fixes a bug where bools arent being nil when marked optional (#7051)
1d294a31b Implement Serialize on generated rust types (#7022)
dd8fccfb1 Cmake 3.16 de-facto minimum version (#7049)
7089c9ecd Convert flatbuffers_version_string to inline function (#7046)
43203984f [C++] Support C++ object copies and moves (#5988)
5993338ee [ts] Builder incorrectly serializing empty strings (#7047)
19920db39 Include a SizePrefixed..HasIdentifier for c++. (#6871)
dbbaeac85 Use `${PYTHON_EXECUTABLE}` instead of `py` in cmake (#7042)
028f0fde6 'flattest': Add --test_path option (#7041)
87343631b Added support for clang-cl on windows (CMake) (#7038)
1fbfaf5c5 Fix/cmake build grpc (#7028)
4421375bb Add FlatBuffers::FlatBuffers interface, needed for FetchContent_Declare (#7023)
162ad7a37 Fix comment with line orders - Rust should be last. (#7037)
a0a6c3f8c Use actions/checkout@v2, which fixes security vulnerability. (#7036)
a2d38fbb9 Add --warnings-as-errors to flatc compiler. (#7034)
9ef1524d3 Emit include for bfbs-gen-embed (#7031)
0c9de0352 Upgraded GRPC version to 1.42.0 (#7033)
a783bc926 chore: dart 2.0.5 release changes (#6983)
aff818ceb rust: Allow for usage in no_std environment (#6989)
d7b75417f Make flatbuffer builder deterministic (#6993)
a42e89897 Added verifier alignment checking to table fields (#7018)
96cc2f3ee BuildFlatBuffers.cmake: fix arguments not passed properly to flatc (#7013)
3250a1f8d Add initial C# vector of unions support to the documentation. (#6880)
ace4a37f2 [TS/JS] BigInt implementation (#6998)
f28c2b293 Avoid implicit conversion from float to double. (#7003)
96f3cf690 Rearrange #include directives to pass to compilation with a particular DSP toolchain (#7000)
b3edfdbfb Reverting grpc generated file suffix (#6995)
b8aaccee8 Disable parsing of nested_flatbuffers as bytes by default
2dc8ae774 Enable OSS-Fuzz on CI
5b0d49112 Updated FlexBuffers fuzzer
d8b7041d7 Added alignment checking to FlexBuffers verifier
5a0c3366c FlexBuffers verifier additionally checks for nesting
f8148b8da Made FlexBuffers reuse tracker track types
a22b1b626 Prevent shadow with _{{FIELD_NAME}} (#6991)
4264daadd FlexBuffers fuzzer fixes
3cbc120a0 Refractor Flatc Options (#6987)
8dcd2682c [CMake] Add option for disable universal on OSX (#6990)
b78002ff3 Validate C# json/object-api options (#6985)
c555ee8fa Add .NET test to github workflows (#6982)
b92bb0584 [CMake]: Fix version in pkgconfig file (#6986)
956d11569 re-enabled FlexBuffer JSON in fuzzer
e367ca32a Verifier for FlexBuffers (#6977)
705f27f6e [CMake]: Fix python command for mingw environment (#6984)
5fc87f4c4 Enable --gen-onefile in Python (#6953)
11749095a Make idl_parser deterministic (#6976)
d0cede9c9 Bumping to Version 2.0.5 (#6967)
fcc2bee0b Fix typo in variable name (#6973)
e08da4dea remove Appveyor's Vs2010 and 13 builds (#6969)
18538c401 [TS] Fix reserved words as arguments (#6955) (#6956)
e57f4ab2d Update stale bot version and provide away to exempt issues with the not-stale label (#6968)
deed68db5 missing generated files (#6966)
061d61f3f Lua Generator using IR. (#6940)
cffe0c454 FixedTypedVector: add const to ElementType() and size() (#6965)
fadd40e40 Have grpc include file with correct filename-suffix given to flatc (#6954)
e47dc0e46 Removed test/generate_code.{sh|bat} (#6873)
5c5475479 switched to windows-lastest, removed deadcode (#6948)
4f7f6dc30 Restore FlatBufferBuilder::kFileIdentifierLength. (#6960)
0fadaf391 Enable verifier on nested_flatbuffers
4d0e9a870 Turn off nested FlatBuffers/FlexBuffers for the fuzzer
c05f6783a invalid conditional running genrate_code.py (#6952)
a14f4052c rust: remove needless borrow (#6922)
9e4ca857b Vector Downward GetSize optimization (#6925)
a2b99084b Fix flexbuffers clang-analyzer warning (#6947)
85b4effac test: fix undefined order of functio parameters. (#6946)
790f41154 [cmake] Fix getting version info from tags during the build (#6936)
e89de4411 clang-all (#6941)
256ab3798 WIP: Dart release 2.0 (#6927)
a59288a01 Add benchmarks to Linux CI (#6928)
587bbd49a [C++] Fix compile failure on Object API union construction for struct member (#6923)
a9c341545 Fix integer overflow warnings
8aa18b629 fixed cmp0048 error (#6932)
d727579b6 fuzzers: fix typo in file path (#6931)
97a30171c Added Raw C++ benchmarks (#6924)
0989fc5e5 Added Google benchmarks (and gtests) (#6920)
927175ea2 [Java] lookup by byteArray is giving back wrong entry (#6915)
6748c373b Removal of support for FLATBUFFERS_CPP98_STL (#6918)
3fab0c6ee move [[ ]] to calling sites (#6914)
6c8c29155 [C++] Split flatbuffers.h into separate files (#6868)
fd4ff23da Keep methods with struct name and switch them to default (#6879)
f8b69e330 [Python] Verify EnumDef is not generated in GenUnionCreator (#6903)
c0394bb09 Support `--conform` for vector of unions (#6883)
8433eb108 Typo fixes in comments of flatbuffers.h and flexbuffers.h (#6901)
f2f9380c8 [Java] Prevent generation of enum names when underlying type is long (#6781) (#6895)
e672dabfe [C++] Fix memory leak when using grpc (#6896) (#6897)
9a4ca2764 Output errors / warnings on stderr instead of stdout (#6881)
4c7a9c10d Adds JSON encoding to swift (#6874)
38295a187 [Kotlin] Fix missing escape for struct construction statements (#6877)
31bb0b972 add working directory (#6878)
45e5642e9 Default Arguments for Mutators C++ [Updated] (#6872)
a592f4c89 [Cmake] Add a post build command after flatc to run the new generate_code.py script. (#6866)
b9d43a557 dart - add Packable interface (#6846)
2ece9e25b Bumped package.json to 2.0.4
2dd212637 Fix linker errors on (Free|Open)BSD. (#6860)
f63c130c2 Improves documentation, and adding DocC (#6784)
e2b26ee19 Make and generate_code.sh generate same outputs (#6855)
9d686bf43 Include subdirectories in published npm package (#6850)
1d26daff3 Use ArrayBuffer type for JS flexbuffer's toObject (#6851)
e72e18d9f feat(build): compile "universal" libraries and executables for Mac (#6852)
354d97f6d fixed errant itemgroup element in C# test project (#6854)
6f7a57eaa [C#] Using 'global::' as qualifying_start_ within BaseGenerator (#6767)
90baa1444 Dart: binary lists (typed_data) (#6839)
0a3b017f0 Delete IDLOptions::lang (#6841)
47d35f105 BugFix: Optional enum when it is null (#6835)
8fb8c2ce1 [C#] Use @ for keyword escaping (#6834)
1d063d87c [C++] Let builder accept custom-alloc std::vector (#6814)
338331b55 Changes to support binary schema file loading and parsing (flatc) (#6823)
156a30c75 Move Apple-specific build flags to Clang section (#6802)
550d2f904 Issue error if jsonschema has no root type defined #6821 (#6831)
c3a38242e Fix typos in docs (#6829)
74c3d7eba [C++] Add mutable version of LookupByKey and test (#6826)
db6eae5c4 Add html and latex to gitignore (#6819)
0e9d79c35 [Java] Avoid casting ByteBuffer to Buffer (#6785)
b20c4d3aa [C++] Add GetMutableSizePrefixedRoot and generate GetMutableSizePrefixedXxx functions (#6815)
ae145293c flattests_cpp17 doesn't compile with Visual Studio 2017: warning C4100: 'indent': unreferenced formal parameter (#6811)
e3c76a5cd Dart lints (#6808)
4b9123baf fix parser string=null (#6810)
f89e0b1a6 Refactor idl_gen_rust and Rust generated code to use consistent whitespace (#6809)
273f6084e Fix Rust keyword inconsistency (#6794)
4a0879458 [C#] Remove superfluous semicolon in C# structs (#6791)
d6f51ea16 fix ptr in flatbuffers cpp tutorial (#6787)
067dce6e7 [C#] Handle keywords (#6775)
2ca5f0e72 [C#] Respect command line parameter for file name extension and suffix (#6779)
f20d2253a update Java version to 2.0.3
390d438e2 [Kotlin] Fix CI by changing compiler to Java 11 (#6783)
6fb2c90d9 avoiding even more NoSuchMethod exceptions (#6729)
a7b527d94 java: Use maven profile to target Java 8 bytecode (#6764)
5d77820b3 [C++] Using calculated fields_number for field_names size (#6769)
909ce970a [C++] Use UnPackTo instead of UnPack if pointer exists (#6725)
35e2cac6e Store vtables sorted in Rust builder (#6765)
c39fc9dd9 [C++] Use nullptr instead of 0 in generated headers (#6762)
775c6567d [C++] Fix compiler warning -Wredundant-parens in clang (#6761)
97d9527f6 Dart 2.0 release prep (#6759)
e01205466 [C++] Use proper gRPC C++ API when using MemoryBuffer Slice (#6756)
5235133f3 Dart - make ascii optimization optional in StringReader, same as in writeString() (#6758)
c871df770 Dart - change table building to assert() instead of exceptions (#6754)
a6eeeb3b9 Dart - inline small functions to increase performance (#6755)
3dd02144d [C#] Fix field name struct name collision (#6744) (#6757)
e77926f0e [C#] Add Union Constructor Utility for ObjectAPI. (#6105)
ac2348202 Dart - fixup writeString() return type after previous merges (#6753)
8be8a0a71 [C++] Fix union type handling on object api in C++17 (#6745)
12e341e4f Rework how Rust generated files are laid out (#6731)
c36672d80 Dart - optimize writeString for ASCII (#6736)
2bfc8e9f0 Dart - make writeString() argument non-nullable (#6737)
674a9f2aa fix lints in rust tests (#6743)
016e6aa13 Add a split on ':' to build_defs.bzl (#6742)
65700441d Dart - make vTable fixed size (expect the number of fields when creating) (#6735)
dd5bb55ca Dart - make vTable deduplication optional (#6734)
e8423da1b Dart - regenerate example after recent flatc changes (#6733)
0980e39c9 flexbuffers: Add variant of Blob() that takes a key (#6730)
e73fab27d Dart - store empty vectors instead of NULL (#6728)
92ae532e4 Dart - finish/lowFinish/buffer changes (#6712)
7482b25f8 Remove ubuntu1604 from presubmit.yml (#6715)
3f77dc9a0 Dart - unpack() must use eager list reader (#6723)
838c93b84 Dart - fix flex-builder compilation error (#6722)
089f48a4a Dart - make sure added padding is zeroed, same as in C++ (#6716)
bf3470c16 Fix UB in CreateVectorOfStructs in case of an empty vector: avoid calling memcpy in this case (#6726)
8f8196e13 Fix 6348 (#6717)
8ab35b2a5 Dart - add custom allocator support (#6711)
c0ba2870c Fix typo in docu (#6714)
22498cf3a [C++] add make_span for Array<T,N> (#6663)
bd37e67ac [C++] Fix a -Wdeprecated-copy warning. (#6708)
a6ee33557 Dart null safety (#6696)
71d43f3be Make --bfbs-filenames default to location of first schema file. (#6705)
c8db1ca5d Jsonschema add prop comments (#6617)
962751a6e Improve generated comparisons for tables (#6486)
06fd6d640 Replace filenames in reflection with filenames+includes. (#6703)
acce4ac3f Fix incorrect assertion usage. (#6702)
8fd7861b7 Fix warning about deprecated module: imp (#6362)
c58ae9422 Add the file a symbol is declared in to Reflection (#6613)
2cf7bb796 Intermediate Representation docs (#6685)
4e3a66c14 Dart object API (#6682)
d959e2320 dart - change Builder.reset() to reuse an existing buffer (#6661)
a9fb54088 use improved versioning (#6691)
337eb8b8f update docs - structs can't be roots (#6690)
6415ef05d [Python] [Codegen] Fixes nested structs with underscore names (#6686)
f069396d1 [C++] flatc --cpp-field-case-style option to permit camel-case field names in C++ (#6669)
021177af0 Fix snap version formatting (#6683)
e1e9f9373 [C++/grpc] added hiding of unused variables in the generated code (#6677)
15110094e Fix GitHub Actions CI gcc/clang versions
093badb0a Use unoptimized path for ReadUInt64 for win32 build as the optimized path crashes. (#6681)
752c7b576 avoiding more NoSuchMethod exceptions (#6671)
7c3e267e1 [Java] ObjectAPI implementation (#6521) (#6582)
baaffbaed npm update to 2.0.3 and script fix
4cb3f222b [TS] Fix module reference in package.json (#6676)
eabdbda75 [TS] Generate entry point module (#6674)
bec23700f Prepare for Java 2.0.1 release
12f2eedad Update CI to GCC/Clang 11
221eeb231 Fix typo in C++ doc (#6664)
813d3632e avoiding NoSuchMethod exception (#6658)
d84bccb0c Removed most heap allocations in builder (#6662)
b4e67f9bf Dart test fix (#6660)
54c11932f [Java] Flexbuffers - Negative signed object length (#6651)
fbcb3c423 [TS/JS] Updates the grpc (#6654)
8937dcfd7 Updates go lang support to allow other languages to communicate with it (#6653)
512d5a689 Update readme.md to point to security policy
a92cb5dd7 Create Security.md
d151dcbb9 Revert "[C++] Removed most heap allocations in builder (#6620)" (#6659)
f1884c66f Fix gRPC test to use EndVector without specifying the length. (#6646)
72730ecd8 [C++] Removed most heap allocations in builder (#6620)
fe2bc2b0a Added README for Rust Flatbuffers (before publishing v=2.0) (#6652)
4867c9456 Fixed generation of c++ code with flags (#6637)
ef0eb3701 Ran clang-format-all.sh. Removed default --style=file parameter (#6639)
f83ee1af5 [idl_parser] Check structs and enums do not clash in a namespace (#6562)
a5175c513 Implements verifier and code gen for swift (#6373)
04b10f5a3 Deprecate EnumVal.object (#6612)
c121c0345 Fixed Java gRPC version number dependency
8fd10606c Implement Serialize for flexbuffer::Reader (#6635)
a1730fcea [Swift] Updated cocoapods to 2.0.0 (#6634)
a9a295fec More missing version changes
5c01ad387 Dart generated code update
42ca1b914 Swift/Kotlin generated code version updates
6ed780dbd C++/Rust version changes
3412fab8e C#/Java generated code version updates
8a7d013f8 Updated main version numbers to 2.0
170af5978 [Go] Add missing namespace when using Object API (#6633)
c8c16de16 Fix reverse iterators for Vector and Array (#6626)
4525cd9c5 [Lua] manipulate byte array as string (#6624)
47361baf6 [C++] Fix union copy constructor to work with nested structs (#6552) (#6607)
8a582883a Updates swift generated monster sample file (#6616)
a4bb8f0c2 [Lua] Avoid infinite loop when creating empty string (#6614)
82aed82b8 Added support for Lua 5.1, 5.2 and 5.4 (#6606)
60ff76630 [TS] Remove wrong and obsolete NS prefix use (#6604)
a27c7d809 Fixed LuaJIT when not compiled with COMPAT mode (#6605)
363220823 removed unneeded type prefixing (#6601)
6b44c605b Bump Rust to 0.9.0 (#6610)
d3cd78a87 [Lua] Add LuaJIT support (#6584)
8fa3dfdb5 Introduce new_from_vec in Rust (also fix formatting) (#6599)
29379e8e4 fix typo in CppUsage.md (#6595)
14725d6c3 [Lua] GetRootAs can accept strings. Made Luatest Benchmarks optional (#6593)
16836ff95 Add advance feature indicators to reflection (#6546)
c87179e73 Rust Remove SafeSliceAccess for Arrays, and fix miri. (#6592)
c24031c36 Mark endian_scalar as unsafe. (#6588)
4ccc52c7a [swift] Implements union strings (#6589)
b82fe0738 [Rust] Fix small mistyping (#6585)
1e7f6c8c7 [TS] Commit the generated tests code (#6579)
84714b109 chore: ensure bash is used to generate code (#6577)
1045d7dd4 [Lua] Fix EnforceNumberAndPack for bool type (#6576)
0c7777596 [TS] Remove duplicated build-ts ci (#6575)
c43ba1752 [Rust] Specify Minimum Supported Rust Version (#6573)
da3bb64ef [Rust] Add support for fixed size arrays (#6548)
151900ba9 [Kotlin][FlexBuffers] Add support for Kotlin-iOS (#6564)
c012f29f9 silenced clippy warning (#6565)
df2df21ec [Kotlin] Bump kotlinx.benchmark dependency to 0.3.0 (#6560)
408e4db4a [TS] Add Build TS to CI jobs (#6524)
4d2364f34 [Kotlin][FlexBuffers] Add support for Kotlin-JS (#6554)
261cf3b20 Default-empty vectors of enums (#6505)
cd67261bb [CI] fixes buildkite (#6544)
1aa0c2f6a Limit formatter to pull requests only (#6540)
4133a39df Rust structz (#6539)
1c26d2a1a [Kotlin][FlexBuffers] JSON support for Flexbuffers (#6417)
276b1bc34 [grpc] Support latest version of grpc PoC (#6338)
124654ffc fixed packing structs (#6530)
3b7d1e86b [GO] Tries to add go format to the CI (#6518)
78f0c0d1d [C++] #6501 - Problem when mapping a native type multiple times (#6514)
c992eafb5 [fuzzer] Add `monster_debug` target (#6513)
ef8dd7792 [Swift] Removes allman rule (#6519)
69b329fc8 [flexbuffers, json] Parse `nan` and `inf` (#6512)
6543ba529 fixed packing structs in nested buffers (#6509)
0e453ac35 [idl_parser] Add kTokenNumericConstant token (#6432)
e9b4ae69d Remove `flatbuffers.pc` from the repository (#6508)
fc4fffea4 Bump grpc to 1.0.0 (#6507)
b240ab704 Move Traits struct and Create method out of --cpp-static-reflection. (#6503)
9a4f1f434 Disable x64-specific optimizations for ARM64EC ReadInt64 (#6506)
fac64918d Add --cpp-static-reflection to generate_code.bat. (#6502)
a69815f72 [C++17] Add compile-time reflection for fields. (#6324)
4033ff589 fixed invalid TS call and added test files (#6495)
a08357251 disable clippy (#6494)
5319dedb1 [idl_parser, JSON] Disable parsing of JSON for incomplete schemes (#6493)
bd4e0b30a [idl_parser] Track included files by hash (#6434)
bf9061200 fix for noUncheckedIndexedAccess in ts (#6474)
8142fedd1 Working on a python example plus fixing python grpc code (#6456)
c0be1cb7a [rust] Remove debug code (#6475)
8cccdfba5 Revert "[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)" (#6488)
cbbbaa61b [C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)
ffc2ef77c [CI] Adds Code Generation tests on Github Actions (#6482)
1da6f4f18 [CMake] generate pkg-config flatbuffers.pc file (#6455)
b5da526e6 [Swift] Moves grpc example to grpc/examples (#6479)
3b5365762 [TS] Moves grpc code to examples folder (#6476)
e2f5438ac Fixes grammer (#6477)
5e3613f73 Fix sample_binary.py to use latest EndVector without a size. (#6478)
e6b911d40 updated JS docs to reflect current status (#6436)
0c7ae5816 [Go] Working on a go example plus fixing go grpc code (#6448)
ae603b977 [Swift] adds support for default vectors and strings (#6461)
7f47718b6 Update Building.md (#6473)
54dc09e8a GetUOffsetT must get value by GetUint32 not GetInt32 (#6072)
334c6be49 Fix a typo in Swift codegen (#6470)
4174c10e7 [rust] Genericize flexbuffer reader (#6450)
a20f606c2 [Swift] Renaming protocols (#6469)
a72a20827 Update swift docs (#6460)
86401e078 Default strings and vectors: Parser + Rust support (#6421)
6af37e672 [CMake] Renames BUILD files (#6457)
1b88655b0 [Build, cmake] Add -Werror override option (#6429)
0b15916e5 [C++]Fix extra char generation for byte type during json schema generation (#6276)
60eed0ca6 Updating working code (#6441)
0f83367f5 JSON schema - tailing double quotes for maximum (#6452)
fee095410 [idl_parser] Validate `force_align` on all possible paths (#6430)
6f3e45eca Implement Rust object API defaults (#6444)
815d3e820 Upgrade swift grpc to alpha 24 (#6439)
76e7a0ff5 [fuzzer] Limit parser_fuzzer execution time (#6431)
6d91096a2 This commit contains the initial implementation of Flexbuffers in Kotlin. The code was ported based (#6387)
13d9e3585 Better python generated code naming (#6336)
6effe431b Rust: remove inner attributes (#6410)
efcbdc769 [Rust] Ensure unions are referenced with the correct path (#6422)
e581013e3 Refactor FieldDef to model presense as an enum rather than 2 bools. (#6420)
0984d4328 [c++] Apply NativeName before WrapInNameSpace in idl_gen_cpp.cpp (#6419)
786f69b24 Formats cpp code (#6349)
1da0a2dfa Rust Object API (#6070)
796ed68fa Clarify that (Flat|Flex)Buffers do not deduplicate vector elements (#6415)
7b1ee31d8 Clarify that FlatBuffers unions do not support scalars (#6416)
4aff1198d Explain how FlatBuffers encodes unions (#6414)
ad3a729f9 dart Builder - expose finished buffer size (#6403)
52e217706 Remove invalid claim that Protocol Buffers does not support unions (#6413)
760c65755 [TS/JS] New gen TS code gen (#6302)
75c859e98 [idl_parser] Improve symbols lookup thru parent namespaces (#6407)
91b0958c4 Search for includes in the directory containg the current file (#6371)
8008dde11 Upgrade Rust dependencies (#6406)
c81cf8249 [TS/JS] New gen TS code gen prequel to preserve history (#6404)
8573108bb Unset FieldDef.optional if its key (#6402)
7abe612b5 [fuzzer] Fix the binary schema loading in the monster_fuzzer (#6396)
408cf5802 Fix Rust UB problems (#6393)
39e115fdb Define Vector::value_type for STL compatibility (#6394)
85719669c [fuzzer] Debug the monster_tets.bfbs on clusterfuzz server (#6392)
809fe49c7 Fix up scripts, fix generated enum value for strong mode, regenerate files (#6389)
41253e574 [go] tests/GoTest.sh: Fix flags.Parse location to work on new go SDKs. (#6388)
08d2ce844 fix Dart Builder._writeString() - always write trailing zero byte (#6390)
a15a8d930 fix Dart Builder.reset() - clear vTables (#6386)
83ce29cc2 [C++, JSON] Fix nullptr access when reading a key with a default value. (#6375)
4363c1d2c Fix generated EndVector. (#6385)
1bf1ec027 Implements type promotion for Java enum  (#6382)
080097653 Delete label_notify.yml
795408115 Disabled PHP CI (#6381)
46545e627 fixed warnings (#6355)
0168178a1 Fix multiple fbs code generation failure (#6365)
82836a62b [idl_parser] Improve stack overflow protection (#6364)
e7430bbeb [idl_parser] Check the range of explicitly set field's id value (#6363)
24dd85fd2 Generate code to encode and decode nested flatbuffers in Python. (#6354)
57f68e289 [Rust] Shared String (#6367)
44cf2bde1 Updates license  date to 2021 (#6378)
be37d4da1 include_prefix support for rust (#6330)
4e79d129c [Swift] Rebuild the way swift handles structs from scratch (#6326)
05192553f Fix typos in usage/comments; Make rust generator respect to --filenam… (#6342)
f2511d7d4 Renaming infinity variables in test.cpp (#6340)
f8b203c9c Add vectorNumElements attribute to Builder for simpler vector creation. (#6328)
8ab7c7e2c [CI] Adds formatter to CI (#6272)
7e0039028 Fix Max CI build path (#6333)
65c415911 Generate nullable properties in C# object-based API for optional scalars. (without -gen-mutable) (#6273)
a9e91116d [Python] Commit some orphan python genfile diffs. (#6325)
80a745d9b Fixed missing ending quotes in labeller (#6327)
9fca5e4f4 Add flatc option to inhibit all warnings #6005 (#6301)
92a806b4e [fuzzer] Rename fuzzing dictionaries for `oss-fuzz` (#6318)
9c9baf6d5 bumprust (#6322)
aafc5dc95 Set default initialSize for Builder to 0 (#6310)
442949bc1 Rust Flatbuffers Verifier (#6269)
9064072e8 Version message should be a "STATUS" to avoid going to stderr. (#6316)
fd4c1b5ff Replace std::string and const char* CreateSharedString with string_view (#6315)
bc7eb8ade [fuzzer] Fix mistakes in the `parser` and `scalar` fuzzers. (#6314)
fc960f367 Add default to offset param of Python generated GetRootAs (#6312)
f437f0f7e [fuzzer] Fix loading of schema in monster_fuzzer (#6308)
7f33cf682 [C++] Switch `flatc` to `--cpp-std c++11` C++ code generator (#6306)
8d9eae9ac [idl_parser] Unify parsing of NaN values read from .fbs and .json files (#6296)
2046bffa4 Moved various language tests from AppVeyor to GitHub Actions (#6300)

git-subtree-dir: third_party/flatbuffers
git-subtree-split: e5f331db998a808f78cf5a4880e6f5d0a321c4d0
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
Change-Id: I37f8aaf007fc86226cfa250169a87807afa64a78
diff --git a/tests/monster_test_my_game.example_generated.dart b/tests/monster_test_my_game.example_generated.dart
index fa8f1ca..dd816d9 100644
--- a/tests/monster_test_my_game.example_generated.dart
+++ b/tests/monster_test_my_game.example_generated.dart
@@ -1,5 +1,5 @@
 // automatically generated by the FlatBuffers compiler, do not modify
-// ignore_for_file: unused_import, unused_field, unused_local_variable
+// ignore_for_file: unused_import, unused_field, unused_element, unused_local_variable
 
 library my_game.example;
 
@@ -15,26 +15,36 @@
   const Color._(this.value);
 
   factory Color.fromValue(int value) {
-    if (value == null) value = 0;
-    if (!values.containsKey(value)) {
-      throw new StateError('Invalid value $value for bit flag enum Color');
+    final result = values[value];
+    if (result == null) {
+      if (value == 0) {
+        return Color._(0);
+      } else {
+        throw StateError('Invalid value $value for bit flag enum Color');
+      }
     }
-    return values[value];
+    return result;
   }
 
+  static Color? _createOrNull(int? value) => 
+      value == null ? null : Color.fromValue(value);
+
   static bool containsValue(int value) => values.containsKey(value);
 
-  static const Color Red = const Color._(1);
+  static const Color Red = Color._(1);
 
   ///  \brief color Green
   ///  Green is bit_flag with value (1u << 1)
-  static const Color Green = const Color._(2);
+  static const Color Green = Color._(2);
 
   ///  \brief color Blue (1u << 3)
-  static const Color Blue = const Color._(8);
-  static const values = {1: Red,2: Green,8: Blue,};
+  static const Color Blue = Color._(8);
+  static const Map<int, Color> values = {
+    1: Red,
+    2: Green,
+    8: Blue};
 
-  static const fb.Reader<Color> reader = const _ColorReader();
+  static const fb.Reader<Color> reader = _ColorReader();
 
   @override
   String toString() {
@@ -50,7 +60,7 @@
 
   @override
   Color read(fb.BufferContext bc, int offset) =>
-      new Color.fromValue(const fb.Uint8Reader().read(bc, offset));
+      Color.fromValue(const fb.Uint8Reader().read(bc, offset));
 }
 
 class Race {
@@ -58,24 +68,31 @@
   const Race._(this.value);
 
   factory Race.fromValue(int value) {
-    if (value == null) value = 0;
-    if (!values.containsKey(value)) {
-      throw new StateError('Invalid value $value for bit flag enum Race');
+    final result = values[value];
+    if (result == null) {
+        throw StateError('Invalid value $value for bit flag enum Race');
     }
-    return values[value];
+    return result;
   }
 
+  static Race? _createOrNull(int? value) => 
+      value == null ? null : Race.fromValue(value);
+
   static const int minValue = -1;
   static const int maxValue = 2;
   static bool containsValue(int value) => values.containsKey(value);
 
-  static const Race None = const Race._(-1);
-  static const Race Human = const Race._(0);
-  static const Race Dwarf = const Race._(1);
-  static const Race Elf = const Race._(2);
-  static const values = {-1: None,0: Human,1: Dwarf,2: Elf,};
+  static const Race None = Race._(-1);
+  static const Race Human = Race._(0);
+  static const Race Dwarf = Race._(1);
+  static const Race Elf = Race._(2);
+  static const Map<int, Race> values = {
+    -1: None,
+    0: Human,
+    1: Dwarf,
+    2: Elf};
 
-  static const fb.Reader<Race> reader = const _RaceReader();
+  static const fb.Reader<Race> reader = _RaceReader();
 
   @override
   String toString() {
@@ -91,7 +108,55 @@
 
   @override
   Race read(fb.BufferContext bc, int offset) =>
-      new Race.fromValue(const fb.Int8Reader().read(bc, offset));
+      Race.fromValue(const fb.Int8Reader().read(bc, offset));
+}
+
+class LongEnum {
+  final int value;
+  const LongEnum._(this.value);
+
+  factory LongEnum.fromValue(int value) {
+    final result = values[value];
+    if (result == null) {
+      if (value == 0) {
+        return LongEnum._(0);
+      } else {
+        throw StateError('Invalid value $value for bit flag enum LongEnum');
+      }
+    }
+    return result;
+  }
+
+  static LongEnum? _createOrNull(int? value) => 
+      value == null ? null : LongEnum.fromValue(value);
+
+  static bool containsValue(int value) => values.containsKey(value);
+
+  static const LongEnum LongOne = LongEnum._(2);
+  static const LongEnum LongTwo = LongEnum._(4);
+  static const LongEnum LongBig = LongEnum._(1099511627776);
+  static const Map<int, LongEnum> values = {
+    2: LongOne,
+    4: LongTwo,
+    1099511627776: LongBig};
+
+  static const fb.Reader<LongEnum> reader = _LongEnumReader();
+
+  @override
+  String toString() {
+    return 'LongEnum{value: $value}';
+  }
+}
+
+class _LongEnumReader extends fb.Reader<LongEnum> {
+  const _LongEnumReader();
+
+  @override
+  int get size => 1;
+
+  @override
+  LongEnum read(fb.BufferContext bc, int offset) =>
+      LongEnum.fromValue(const fb.Uint64Reader().read(bc, offset));
 }
 
 class AnyTypeId {
@@ -99,24 +164,31 @@
   const AnyTypeId._(this.value);
 
   factory AnyTypeId.fromValue(int value) {
-    if (value == null) value = 0;
-    if (!values.containsKey(value)) {
-      throw new StateError('Invalid value $value for bit flag enum AnyTypeId');
+    final result = values[value];
+    if (result == null) {
+        throw StateError('Invalid value $value for bit flag enum AnyTypeId');
     }
-    return values[value];
+    return result;
   }
 
+  static AnyTypeId? _createOrNull(int? value) => 
+      value == null ? null : AnyTypeId.fromValue(value);
+
   static const int minValue = 0;
   static const int maxValue = 3;
   static bool containsValue(int value) => values.containsKey(value);
 
-  static const AnyTypeId NONE = const AnyTypeId._(0);
-  static const AnyTypeId Monster = const AnyTypeId._(1);
-  static const AnyTypeId TestSimpleTableWithEnum = const AnyTypeId._(2);
-  static const AnyTypeId MyGame_Example2_Monster = const AnyTypeId._(3);
-  static const values = {0: NONE,1: Monster,2: TestSimpleTableWithEnum,3: MyGame_Example2_Monster,};
+  static const AnyTypeId NONE = AnyTypeId._(0);
+  static const AnyTypeId Monster = AnyTypeId._(1);
+  static const AnyTypeId TestSimpleTableWithEnum = AnyTypeId._(2);
+  static const AnyTypeId MyGame_Example2_Monster = AnyTypeId._(3);
+  static const Map<int, AnyTypeId> values = {
+    0: NONE,
+    1: Monster,
+    2: TestSimpleTableWithEnum,
+    3: MyGame_Example2_Monster};
 
-  static const fb.Reader<AnyTypeId> reader = const _AnyTypeIdReader();
+  static const fb.Reader<AnyTypeId> reader = _AnyTypeIdReader();
 
   @override
   String toString() {
@@ -132,7 +204,7 @@
 
   @override
   AnyTypeId read(fb.BufferContext bc, int offset) =>
-      new AnyTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
+      AnyTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
 }
 
 class AnyUniqueAliasesTypeId {
@@ -140,24 +212,31 @@
   const AnyUniqueAliasesTypeId._(this.value);
 
   factory AnyUniqueAliasesTypeId.fromValue(int value) {
-    if (value == null) value = 0;
-    if (!values.containsKey(value)) {
-      throw new StateError('Invalid value $value for bit flag enum AnyUniqueAliasesTypeId');
+    final result = values[value];
+    if (result == null) {
+        throw StateError('Invalid value $value for bit flag enum AnyUniqueAliasesTypeId');
     }
-    return values[value];
+    return result;
   }
 
+  static AnyUniqueAliasesTypeId? _createOrNull(int? value) => 
+      value == null ? null : AnyUniqueAliasesTypeId.fromValue(value);
+
   static const int minValue = 0;
   static const int maxValue = 3;
   static bool containsValue(int value) => values.containsKey(value);
 
-  static const AnyUniqueAliasesTypeId NONE = const AnyUniqueAliasesTypeId._(0);
-  static const AnyUniqueAliasesTypeId M = const AnyUniqueAliasesTypeId._(1);
-  static const AnyUniqueAliasesTypeId TS = const AnyUniqueAliasesTypeId._(2);
-  static const AnyUniqueAliasesTypeId M2 = const AnyUniqueAliasesTypeId._(3);
-  static const values = {0: NONE,1: M,2: TS,3: M2,};
+  static const AnyUniqueAliasesTypeId NONE = AnyUniqueAliasesTypeId._(0);
+  static const AnyUniqueAliasesTypeId M = AnyUniqueAliasesTypeId._(1);
+  static const AnyUniqueAliasesTypeId TS = AnyUniqueAliasesTypeId._(2);
+  static const AnyUniqueAliasesTypeId M2 = AnyUniqueAliasesTypeId._(3);
+  static const Map<int, AnyUniqueAliasesTypeId> values = {
+    0: NONE,
+    1: M,
+    2: TS,
+    3: M2};
 
-  static const fb.Reader<AnyUniqueAliasesTypeId> reader = const _AnyUniqueAliasesTypeIdReader();
+  static const fb.Reader<AnyUniqueAliasesTypeId> reader = _AnyUniqueAliasesTypeIdReader();
 
   @override
   String toString() {
@@ -173,7 +252,7 @@
 
   @override
   AnyUniqueAliasesTypeId read(fb.BufferContext bc, int offset) =>
-      new AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
+      AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
 }
 
 class AnyAmbiguousAliasesTypeId {
@@ -181,24 +260,31 @@
   const AnyAmbiguousAliasesTypeId._(this.value);
 
   factory AnyAmbiguousAliasesTypeId.fromValue(int value) {
-    if (value == null) value = 0;
-    if (!values.containsKey(value)) {
-      throw new StateError('Invalid value $value for bit flag enum AnyAmbiguousAliasesTypeId');
+    final result = values[value];
+    if (result == null) {
+        throw StateError('Invalid value $value for bit flag enum AnyAmbiguousAliasesTypeId');
     }
-    return values[value];
+    return result;
   }
 
+  static AnyAmbiguousAliasesTypeId? _createOrNull(int? value) => 
+      value == null ? null : AnyAmbiguousAliasesTypeId.fromValue(value);
+
   static const int minValue = 0;
   static const int maxValue = 3;
   static bool containsValue(int value) => values.containsKey(value);
 
-  static const AnyAmbiguousAliasesTypeId NONE = const AnyAmbiguousAliasesTypeId._(0);
-  static const AnyAmbiguousAliasesTypeId M1 = const AnyAmbiguousAliasesTypeId._(1);
-  static const AnyAmbiguousAliasesTypeId M2 = const AnyAmbiguousAliasesTypeId._(2);
-  static const AnyAmbiguousAliasesTypeId M3 = const AnyAmbiguousAliasesTypeId._(3);
-  static const values = {0: NONE,1: M1,2: M2,3: M3,};
+  static const AnyAmbiguousAliasesTypeId NONE = AnyAmbiguousAliasesTypeId._(0);
+  static const AnyAmbiguousAliasesTypeId M1 = AnyAmbiguousAliasesTypeId._(1);
+  static const AnyAmbiguousAliasesTypeId M2 = AnyAmbiguousAliasesTypeId._(2);
+  static const AnyAmbiguousAliasesTypeId M3 = AnyAmbiguousAliasesTypeId._(3);
+  static const Map<int, AnyAmbiguousAliasesTypeId> values = {
+    0: NONE,
+    1: M1,
+    2: M2,
+    3: M3};
 
-  static const fb.Reader<AnyAmbiguousAliasesTypeId> reader = const _AnyAmbiguousAliasesTypeIdReader();
+  static const fb.Reader<AnyAmbiguousAliasesTypeId> reader = _AnyAmbiguousAliasesTypeIdReader();
 
   @override
   String toString() {
@@ -214,13 +300,13 @@
 
   @override
   AnyAmbiguousAliasesTypeId read(fb.BufferContext bc, int offset) =>
-      new AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
+      AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().read(bc, offset));
 }
 
 class Test {
   Test._(this._bc, this._bcOffset);
 
-  static const fb.Reader<Test> reader = const _TestReader();
+  static const fb.Reader<Test> reader = _TestReader();
 
   final fb.BufferContext _bc;
   final int _bcOffset;
@@ -232,6 +318,37 @@
   String toString() {
     return 'Test{a: $a, b: $b}';
   }
+
+  TestT unpack() => TestT(
+      a: a,
+      b: b);
+
+  static int pack(fb.Builder fbBuilder, TestT? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+class TestT implements fb.Packable {
+  int a;
+  int b;
+
+  TestT({
+      required this.a,
+      required this.b});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    fbBuilder.pad(1);
+    fbBuilder.putInt8(b);
+    fbBuilder.putInt16(a);
+    return fbBuilder.offset;
+  }
+
+  @override
+  String toString() {
+    return 'TestT{a: $a, b: $b}';
+  }
 }
 
 class _TestReader extends fb.StructReader<Test> {
@@ -242,13 +359,11 @@
 
   @override
   Test createObject(fb.BufferContext bc, int offset) => 
-    new Test._(bc, offset);
+    Test._(bc, offset);
 }
 
 class TestBuilder {
-  TestBuilder(this.fbBuilder) {
-    assert(fbBuilder != null);
-  }
+  TestBuilder(this.fbBuilder);
 
   final fb.Builder fbBuilder;
 
@@ -266,18 +381,15 @@
   final int _b;
 
   TestObjectBuilder({
-    int a,
-    int b,
+    required int a,
+    required int b,
   })
       : _a = a,
         _b = b;
 
   /// Finish building, and store into the [fbBuilder].
   @override
-  int finish(
-    fb.Builder fbBuilder) {
-    assert(fbBuilder != null);
-
+  int finish(fb.Builder fbBuilder) {
     fbBuilder.pad(1);
     fbBuilder.putInt8(_b);
     fbBuilder.putInt16(_a);
@@ -286,30 +398,57 @@
 
   /// Convenience method to serialize to byte list.
   @override
-  Uint8List toBytes([String fileIdentifier]) {
-    fb.Builder fbBuilder = new fb.Builder();
-    int offset = finish(fbBuilder);
-    return fbBuilder.finish(offset, fileIdentifier);
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
   }
 }
 class TestSimpleTableWithEnum {
   TestSimpleTableWithEnum._(this._bc, this._bcOffset);
   factory TestSimpleTableWithEnum(List<int> bytes) {
-    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
+    final rootRef = fb.BufferContext.fromBytes(bytes);
     return reader.read(rootRef, 0);
   }
 
-  static const fb.Reader<TestSimpleTableWithEnum> reader = const _TestSimpleTableWithEnumReader();
+  static const fb.Reader<TestSimpleTableWithEnum> reader = _TestSimpleTableWithEnumReader();
 
   final fb.BufferContext _bc;
   final int _bcOffset;
 
-  Color get color => new Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 4, 2));
+  Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 4, 2));
 
   @override
   String toString() {
     return 'TestSimpleTableWithEnum{color: $color}';
   }
+
+  TestSimpleTableWithEnumT unpack() => TestSimpleTableWithEnumT(
+      color: color);
+
+  static int pack(fb.Builder fbBuilder, TestSimpleTableWithEnumT? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+class TestSimpleTableWithEnumT implements fb.Packable {
+  Color color;
+
+  TestSimpleTableWithEnumT({
+      this.color = Color.Green});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    fbBuilder.startTable(1);
+    fbBuilder.addUint8(0, color.value);
+    return fbBuilder.endTable();
+  }
+
+  @override
+  String toString() {
+    return 'TestSimpleTableWithEnumT{color: $color}';
+  }
 }
 
 class _TestSimpleTableWithEnumReader extends fb.TableReader<TestSimpleTableWithEnum> {
@@ -317,21 +456,19 @@
 
   @override
   TestSimpleTableWithEnum createObject(fb.BufferContext bc, int offset) => 
-    new TestSimpleTableWithEnum._(bc, offset);
+    TestSimpleTableWithEnum._(bc, offset);
 }
 
 class TestSimpleTableWithEnumBuilder {
-  TestSimpleTableWithEnumBuilder(this.fbBuilder) {
-    assert(fbBuilder != null);
-  }
+  TestSimpleTableWithEnumBuilder(this.fbBuilder);
 
   final fb.Builder fbBuilder;
 
   void begin() {
-    fbBuilder.startTable();
+    fbBuilder.startTable(1);
   }
 
-  int addColor(Color color) {
+  int addColor(Color? color) {
     fbBuilder.addUint8(0, color?.value);
     return fbBuilder.offset;
   }
@@ -342,36 +479,33 @@
 }
 
 class TestSimpleTableWithEnumObjectBuilder extends fb.ObjectBuilder {
-  final Color _color;
+  final Color? _color;
 
   TestSimpleTableWithEnumObjectBuilder({
-    Color color,
+    Color? color,
   })
       : _color = color;
 
   /// Finish building, and store into the [fbBuilder].
   @override
-  int finish(
-    fb.Builder fbBuilder) {
-    assert(fbBuilder != null);
-
-    fbBuilder.startTable();
+  int finish(fb.Builder fbBuilder) {
+    fbBuilder.startTable(1);
     fbBuilder.addUint8(0, _color?.value);
     return fbBuilder.endTable();
   }
 
   /// Convenience method to serialize to byte list.
   @override
-  Uint8List toBytes([String fileIdentifier]) {
-    fb.Builder fbBuilder = new fb.Builder();
-    int offset = finish(fbBuilder);
-    return fbBuilder.finish(offset, fileIdentifier);
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
   }
 }
 class Vec3 {
   Vec3._(this._bc, this._bcOffset);
 
-  static const fb.Reader<Vec3> reader = const _Vec3Reader();
+  static const fb.Reader<Vec3> reader = _Vec3Reader();
 
   final fb.BufferContext _bc;
   final int _bcOffset;
@@ -380,13 +514,62 @@
   double get y => const fb.Float32Reader().read(_bc, _bcOffset + 4);
   double get z => const fb.Float32Reader().read(_bc, _bcOffset + 8);
   double get test1 => const fb.Float64Reader().read(_bc, _bcOffset + 16);
-  Color get test2 => new Color.fromValue(const fb.Uint8Reader().read(_bc, _bcOffset + 24));
+  Color get test2 => Color.fromValue(const fb.Uint8Reader().read(_bc, _bcOffset + 24));
   Test get test3 => Test.reader.read(_bc, _bcOffset + 26);
 
   @override
   String toString() {
     return 'Vec3{x: $x, y: $y, z: $z, test1: $test1, test2: $test2, test3: $test3}';
   }
+
+  Vec3T unpack() => Vec3T(
+      x: x,
+      y: y,
+      z: z,
+      test1: test1,
+      test2: test2,
+      test3: test3.unpack());
+
+  static int pack(fb.Builder fbBuilder, Vec3T? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+class Vec3T implements fb.Packable {
+  double x;
+  double y;
+  double z;
+  double test1;
+  Color test2;
+  TestT test3;
+
+  Vec3T({
+      required this.x,
+      required this.y,
+      required this.z,
+      required this.test1,
+      required this.test2,
+      required this.test3});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    fbBuilder.pad(2);
+    test3.pack(fbBuilder);
+    fbBuilder.pad(1);
+    fbBuilder.putUint8(test2.value);
+    fbBuilder.putFloat64(test1);
+    fbBuilder.pad(4);
+    fbBuilder.putFloat32(z);
+    fbBuilder.putFloat32(y);
+    fbBuilder.putFloat32(x);
+    return fbBuilder.offset;
+  }
+
+  @override
+  String toString() {
+    return 'Vec3T{x: $x, y: $y, z: $z, test1: $test1, test2: $test2, test3: $test3}';
+  }
 }
 
 class _Vec3Reader extends fb.StructReader<Vec3> {
@@ -397,13 +580,11 @@
 
   @override
   Vec3 createObject(fb.BufferContext bc, int offset) => 
-    new Vec3._(bc, offset);
+    Vec3._(bc, offset);
 }
 
 class Vec3Builder {
-  Vec3Builder(this.fbBuilder) {
-    assert(fbBuilder != null);
-  }
+  Vec3Builder(this.fbBuilder);
 
   final fb.Builder fbBuilder;
 
@@ -411,7 +592,7 @@
     fbBuilder.pad(2);
     test3();
     fbBuilder.pad(1);
-    fbBuilder.putUint8(test2?.value);
+    fbBuilder.putUint8(test2.value);
     fbBuilder.putFloat64(test1);
     fbBuilder.pad(4);
     fbBuilder.putFloat32(z);
@@ -431,12 +612,12 @@
   final TestObjectBuilder _test3;
 
   Vec3ObjectBuilder({
-    double x,
-    double y,
-    double z,
-    double test1,
-    Color test2,
-    TestObjectBuilder test3,
+    required double x,
+    required double y,
+    required double z,
+    required double test1,
+    required Color test2,
+    required TestObjectBuilder test3,
   })
       : _x = x,
         _y = y,
@@ -447,14 +628,11 @@
 
   /// Finish building, and store into the [fbBuilder].
   @override
-  int finish(
-    fb.Builder fbBuilder) {
-    assert(fbBuilder != null);
-
+  int finish(fb.Builder fbBuilder) {
     fbBuilder.pad(2);
     _test3.finish(fbBuilder);
     fbBuilder.pad(1);
-    fbBuilder.putUint8(_test2?.value);
+    fbBuilder.putUint8(_test2.value);
     fbBuilder.putFloat64(_test1);
     fbBuilder.pad(4);
     fbBuilder.putFloat32(_z);
@@ -465,16 +643,16 @@
 
   /// Convenience method to serialize to byte list.
   @override
-  Uint8List toBytes([String fileIdentifier]) {
-    fb.Builder fbBuilder = new fb.Builder();
-    int offset = finish(fbBuilder);
-    return fbBuilder.finish(offset, fileIdentifier);
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
   }
 }
 class Ability {
   Ability._(this._bc, this._bcOffset);
 
-  static const fb.Reader<Ability> reader = const _AbilityReader();
+  static const fb.Reader<Ability> reader = _AbilityReader();
 
   final fb.BufferContext _bc;
   final int _bcOffset;
@@ -486,6 +664,36 @@
   String toString() {
     return 'Ability{id: $id, distance: $distance}';
   }
+
+  AbilityT unpack() => AbilityT(
+      id: id,
+      distance: distance);
+
+  static int pack(fb.Builder fbBuilder, AbilityT? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+class AbilityT implements fb.Packable {
+  int id;
+  int distance;
+
+  AbilityT({
+      required this.id,
+      required this.distance});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    fbBuilder.putUint32(distance);
+    fbBuilder.putUint32(id);
+    return fbBuilder.offset;
+  }
+
+  @override
+  String toString() {
+    return 'AbilityT{id: $id, distance: $distance}';
+  }
 }
 
 class _AbilityReader extends fb.StructReader<Ability> {
@@ -496,13 +704,11 @@
 
   @override
   Ability createObject(fb.BufferContext bc, int offset) => 
-    new Ability._(bc, offset);
+    Ability._(bc, offset);
 }
 
 class AbilityBuilder {
-  AbilityBuilder(this.fbBuilder) {
-    assert(fbBuilder != null);
-  }
+  AbilityBuilder(this.fbBuilder);
 
   final fb.Builder fbBuilder;
 
@@ -519,18 +725,15 @@
   final int _distance;
 
   AbilityObjectBuilder({
-    int id,
-    int distance,
+    required int id,
+    required int distance,
   })
       : _id = id,
         _distance = distance;
 
   /// Finish building, and store into the [fbBuilder].
   @override
-  int finish(
-    fb.Builder fbBuilder) {
-    assert(fbBuilder != null);
-
+  int finish(fb.Builder fbBuilder) {
     fbBuilder.putUint32(_distance);
     fbBuilder.putUint32(_id);
     return fbBuilder.offset;
@@ -538,25 +741,133 @@
 
   /// Convenience method to serialize to byte list.
   @override
-  Uint8List toBytes([String fileIdentifier]) {
-    fb.Builder fbBuilder = new fb.Builder();
-    int offset = finish(fbBuilder);
-    return fbBuilder.finish(offset, fileIdentifier);
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
+  }
+}
+class StructOfStructs {
+  StructOfStructs._(this._bc, this._bcOffset);
+
+  static const fb.Reader<StructOfStructs> reader = _StructOfStructsReader();
+
+  final fb.BufferContext _bc;
+  final int _bcOffset;
+
+  Ability get a => Ability.reader.read(_bc, _bcOffset + 0);
+  Test get b => Test.reader.read(_bc, _bcOffset + 8);
+  Ability get c => Ability.reader.read(_bc, _bcOffset + 12);
+
+  @override
+  String toString() {
+    return 'StructOfStructs{a: $a, b: $b, c: $c}';
+  }
+
+  StructOfStructsT unpack() => StructOfStructsT(
+      a: a.unpack(),
+      b: b.unpack(),
+      c: c.unpack());
+
+  static int pack(fb.Builder fbBuilder, StructOfStructsT? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+class StructOfStructsT implements fb.Packable {
+  AbilityT a;
+  TestT b;
+  AbilityT c;
+
+  StructOfStructsT({
+      required this.a,
+      required this.b,
+      required this.c});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    c.pack(fbBuilder);
+    b.pack(fbBuilder);
+    a.pack(fbBuilder);
+    return fbBuilder.offset;
+  }
+
+  @override
+  String toString() {
+    return 'StructOfStructsT{a: $a, b: $b, c: $c}';
+  }
+}
+
+class _StructOfStructsReader extends fb.StructReader<StructOfStructs> {
+  const _StructOfStructsReader();
+
+  @override
+  int get size => 20;
+
+  @override
+  StructOfStructs createObject(fb.BufferContext bc, int offset) => 
+    StructOfStructs._(bc, offset);
+}
+
+class StructOfStructsBuilder {
+  StructOfStructsBuilder(this.fbBuilder);
+
+  final fb.Builder fbBuilder;
+
+  int finish(fb.StructBuilder a, fb.StructBuilder b, fb.StructBuilder c) {
+    c();
+    b();
+    a();
+    return fbBuilder.offset;
+  }
+
+}
+
+class StructOfStructsObjectBuilder extends fb.ObjectBuilder {
+  final AbilityObjectBuilder _a;
+  final TestObjectBuilder _b;
+  final AbilityObjectBuilder _c;
+
+  StructOfStructsObjectBuilder({
+    required AbilityObjectBuilder a,
+    required TestObjectBuilder b,
+    required AbilityObjectBuilder c,
+  })
+      : _a = a,
+        _b = b,
+        _c = c;
+
+  /// Finish building, and store into the [fbBuilder].
+  @override
+  int finish(fb.Builder fbBuilder) {
+    _c.finish(fbBuilder);
+    _b.finish(fbBuilder);
+    _a.finish(fbBuilder);
+    return fbBuilder.offset;
+  }
+
+  /// Convenience method to serialize to byte list.
+  @override
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
   }
 }
 class Stat {
   Stat._(this._bc, this._bcOffset);
   factory Stat(List<int> bytes) {
-    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
+    final rootRef = fb.BufferContext.fromBytes(bytes);
     return reader.read(rootRef, 0);
   }
 
-  static const fb.Reader<Stat> reader = const _StatReader();
+  static const fb.Reader<Stat> reader = _StatReader();
 
   final fb.BufferContext _bc;
   final int _bcOffset;
 
-  String get id => const fb.StringReader().vTableGet(_bc, _bcOffset, 4, null);
+  String? get id => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 4);
   int get val => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 6, 0);
   int get count => const fb.Uint16Reader().vTableGet(_bc, _bcOffset, 8, 0);
 
@@ -564,6 +875,43 @@
   String toString() {
     return 'Stat{id: $id, val: $val, count: $count}';
   }
+
+  StatT unpack() => StatT(
+      id: id,
+      val: val,
+      count: count);
+
+  static int pack(fb.Builder fbBuilder, StatT? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+class StatT implements fb.Packable {
+  String? id;
+  int val;
+  int count;
+
+  StatT({
+      this.id,
+      this.val = 0,
+      this.count = 0});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    final int? idOffset = id == null ? null
+        : fbBuilder.writeString(id!);
+    fbBuilder.startTable(3);
+    fbBuilder.addOffset(0, idOffset);
+    fbBuilder.addInt64(1, val);
+    fbBuilder.addUint16(2, count);
+    return fbBuilder.endTable();
+  }
+
+  @override
+  String toString() {
+    return 'StatT{id: $id, val: $val, count: $count}';
+  }
 }
 
 class _StatReader extends fb.TableReader<Stat> {
@@ -571,29 +919,27 @@
 
   @override
   Stat createObject(fb.BufferContext bc, int offset) => 
-    new Stat._(bc, offset);
+    Stat._(bc, offset);
 }
 
 class StatBuilder {
-  StatBuilder(this.fbBuilder) {
-    assert(fbBuilder != null);
-  }
+  StatBuilder(this.fbBuilder);
 
   final fb.Builder fbBuilder;
 
   void begin() {
-    fbBuilder.startTable();
+    fbBuilder.startTable(3);
   }
 
-  int addIdOffset(int offset) {
+  int addIdOffset(int? offset) {
     fbBuilder.addOffset(0, offset);
     return fbBuilder.offset;
   }
-  int addVal(int val) {
+  int addVal(int? val) {
     fbBuilder.addInt64(1, val);
     return fbBuilder.offset;
   }
-  int addCount(int count) {
+  int addCount(int? count) {
     fbBuilder.addUint16(2, count);
     return fbBuilder.offset;
   }
@@ -604,14 +950,14 @@
 }
 
 class StatObjectBuilder extends fb.ObjectBuilder {
-  final String _id;
-  final int _val;
-  final int _count;
+  final String? _id;
+  final int? _val;
+  final int? _count;
 
   StatObjectBuilder({
-    String id,
-    int val,
-    int count,
+    String? id,
+    int? val,
+    int? count,
   })
       : _id = id,
         _val = val,
@@ -619,15 +965,11 @@
 
   /// Finish building, and store into the [fbBuilder].
   @override
-  int finish(
-    fb.Builder fbBuilder) {
-    assert(fbBuilder != null);
-    final int idOffset = fbBuilder.writeString(_id);
-
-    fbBuilder.startTable();
-    if (idOffset != null) {
-      fbBuilder.addOffset(0, idOffset);
-    }
+  int finish(fb.Builder fbBuilder) {
+    final int? idOffset = _id == null ? null
+        : fbBuilder.writeString(_id!);
+    fbBuilder.startTable(3);
+    fbBuilder.addOffset(0, idOffset);
     fbBuilder.addInt64(1, _val);
     fbBuilder.addUint16(2, _count);
     return fbBuilder.endTable();
@@ -635,20 +977,20 @@
 
   /// Convenience method to serialize to byte list.
   @override
-  Uint8List toBytes([String fileIdentifier]) {
-    fb.Builder fbBuilder = new fb.Builder();
-    int offset = finish(fbBuilder);
-    return fbBuilder.finish(offset, fileIdentifier);
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
   }
 }
 class Referrable {
   Referrable._(this._bc, this._bcOffset);
   factory Referrable(List<int> bytes) {
-    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
+    final rootRef = fb.BufferContext.fromBytes(bytes);
     return reader.read(rootRef, 0);
   }
 
-  static const fb.Reader<Referrable> reader = const _ReferrableReader();
+  static const fb.Reader<Referrable> reader = _ReferrableReader();
 
   final fb.BufferContext _bc;
   final int _bcOffset;
@@ -659,6 +1001,33 @@
   String toString() {
     return 'Referrable{id: $id}';
   }
+
+  ReferrableT unpack() => ReferrableT(
+      id: id);
+
+  static int pack(fb.Builder fbBuilder, ReferrableT? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+class ReferrableT implements fb.Packable {
+  int id;
+
+  ReferrableT({
+      this.id = 0});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    fbBuilder.startTable(1);
+    fbBuilder.addUint64(0, id);
+    return fbBuilder.endTable();
+  }
+
+  @override
+  String toString() {
+    return 'ReferrableT{id: $id}';
+  }
 }
 
 class _ReferrableReader extends fb.TableReader<Referrable> {
@@ -666,21 +1035,19 @@
 
   @override
   Referrable createObject(fb.BufferContext bc, int offset) => 
-    new Referrable._(bc, offset);
+    Referrable._(bc, offset);
 }
 
 class ReferrableBuilder {
-  ReferrableBuilder(this.fbBuilder) {
-    assert(fbBuilder != null);
-  }
+  ReferrableBuilder(this.fbBuilder);
 
   final fb.Builder fbBuilder;
 
   void begin() {
-    fbBuilder.startTable();
+    fbBuilder.startTable(1);
   }
 
-  int addId(int id) {
+  int addId(int? id) {
     fbBuilder.addUint64(0, id);
     return fbBuilder.offset;
   }
@@ -691,68 +1058,65 @@
 }
 
 class ReferrableObjectBuilder extends fb.ObjectBuilder {
-  final int _id;
+  final int? _id;
 
   ReferrableObjectBuilder({
-    int id,
+    int? id,
   })
       : _id = id;
 
   /// Finish building, and store into the [fbBuilder].
   @override
-  int finish(
-    fb.Builder fbBuilder) {
-    assert(fbBuilder != null);
-
-    fbBuilder.startTable();
+  int finish(fb.Builder fbBuilder) {
+    fbBuilder.startTable(1);
     fbBuilder.addUint64(0, _id);
     return fbBuilder.endTable();
   }
 
   /// Convenience method to serialize to byte list.
   @override
-  Uint8List toBytes([String fileIdentifier]) {
-    fb.Builder fbBuilder = new fb.Builder();
-    int offset = finish(fbBuilder);
-    return fbBuilder.finish(offset, fileIdentifier);
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
   }
 }
 ///  an example documentation comment: "monster object"
 class Monster {
   Monster._(this._bc, this._bcOffset);
   factory Monster(List<int> bytes) {
-    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
+    final rootRef = fb.BufferContext.fromBytes(bytes);
     return reader.read(rootRef, 0);
   }
 
-  static const fb.Reader<Monster> reader = const _MonsterReader();
+  static const fb.Reader<Monster> reader = _MonsterReader();
 
   final fb.BufferContext _bc;
   final int _bcOffset;
 
-  Vec3 get pos => Vec3.reader.vTableGet(_bc, _bcOffset, 4, null);
+  Vec3? get pos => Vec3.reader.vTableGetNullable(_bc, _bcOffset, 4);
   int get mana => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 6, 150);
   int get hp => const fb.Int16Reader().vTableGet(_bc, _bcOffset, 8, 100);
-  String get name => const fb.StringReader().vTableGet(_bc, _bcOffset, 10, null);
-  List<int> get inventory => const fb.ListReader<int>(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 14, null);
-  Color get color => new Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 16, 8));
-  AnyTypeId get testType => new AnyTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 18, 0));
+  String? get name => const fb.StringReader().vTableGetNullable(_bc, _bcOffset, 10);
+  List<int>? get inventory => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 14);
+  Color get color => Color.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 16, 8));
+  AnyTypeId? get testType => AnyTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 18));
   dynamic get test {
     switch (testType?.value) {
-      case 1: return Monster.reader.vTableGet(_bc, _bcOffset, 20, null);
-      case 2: return TestSimpleTableWithEnum.reader.vTableGet(_bc, _bcOffset, 20, null);
-      case 3: return my_game_example2.Monster.reader.vTableGet(_bc, _bcOffset, 20, null);
+      case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 20);
+      case 2: return TestSimpleTableWithEnum.reader.vTableGetNullable(_bc, _bcOffset, 20);
+      case 3: return my_game_example2.Monster.reader.vTableGetNullable(_bc, _bcOffset, 20);
       default: return null;
     }
   }
-  List<Test> get test4 => const fb.ListReader<Test>(Test.reader).vTableGet(_bc, _bcOffset, 22, null);
-  List<String> get testarrayofstring => const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bc, _bcOffset, 24, null);
+  List<Test>? get test4 => const fb.ListReader<Test>(Test.reader).vTableGetNullable(_bc, _bcOffset, 22);
+  List<String>? get testarrayofstring => const fb.ListReader<String>(fb.StringReader()).vTableGetNullable(_bc, _bcOffset, 24);
   ///  an example documentation comment: this will end up in the generated code
   ///  multiline too
-  List<Monster> get testarrayoftables => const fb.ListReader<Monster>(Monster.reader).vTableGet(_bc, _bcOffset, 26, null);
-  Monster get enemy => Monster.reader.vTableGet(_bc, _bcOffset, 28, null);
-  List<int> get testnestedflatbuffer => const fb.ListReader<int>(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 30, null);
-  Stat get testempty => Stat.reader.vTableGet(_bc, _bcOffset, 32, null);
+  List<Monster>? get testarrayoftables => const fb.ListReader<Monster>(Monster.reader).vTableGetNullable(_bc, _bcOffset, 26);
+  Monster? get enemy => Monster.reader.vTableGetNullable(_bc, _bcOffset, 28);
+  List<int>? get testnestedflatbuffer => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 30);
+  Stat? get testempty => Stat.reader.vTableGetNullable(_bc, _bcOffset, 32);
   bool get testbool => const fb.BoolReader().vTableGet(_bc, _bcOffset, 34, false);
   int get testhashs32Fnv1 => const fb.Int32Reader().vTableGet(_bc, _bcOffset, 36, 0);
   int get testhashu32Fnv1 => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 38, 0);
@@ -762,50 +1126,353 @@
   int get testhashu32Fnv1a => const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 46, 0);
   int get testhashs64Fnv1a => const fb.Int64Reader().vTableGet(_bc, _bcOffset, 48, 0);
   int get testhashu64Fnv1a => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 50, 0);
-  List<bool> get testarrayofbools => const fb.ListReader<bool>(const fb.BoolReader()).vTableGet(_bc, _bcOffset, 52, null);
+  List<bool>? get testarrayofbools => const fb.ListReader<bool>(fb.BoolReader()).vTableGetNullable(_bc, _bcOffset, 52);
   double get testf => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 54, 3.14159);
   double get testf2 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 56, 3.0);
   double get testf3 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 58, 0.0);
-  List<String> get testarrayofstring2 => const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bc, _bcOffset, 60, null);
-  List<Ability> get testarrayofsortedstruct => const fb.ListReader<Ability>(Ability.reader).vTableGet(_bc, _bcOffset, 62, null);
-  List<int> get flex => const fb.ListReader<int>(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 64, null);
-  List<Test> get test5 => const fb.ListReader<Test>(Test.reader).vTableGet(_bc, _bcOffset, 66, null);
-  List<int> get vectorOfLongs => const fb.ListReader<int>(const fb.Int64Reader()).vTableGet(_bc, _bcOffset, 68, null);
-  List<double> get vectorOfDoubles => const fb.ListReader<double>(const fb.Float64Reader()).vTableGet(_bc, _bcOffset, 70, null);
-  my_game.InParentNamespace get parentNamespaceTest => my_game.InParentNamespace.reader.vTableGet(_bc, _bcOffset, 72, null);
-  List<Referrable> get vectorOfReferrables => const fb.ListReader<Referrable>(Referrable.reader).vTableGet(_bc, _bcOffset, 74, null);
+  List<String>? get testarrayofstring2 => const fb.ListReader<String>(fb.StringReader()).vTableGetNullable(_bc, _bcOffset, 60);
+  List<Ability>? get testarrayofsortedstruct => const fb.ListReader<Ability>(Ability.reader).vTableGetNullable(_bc, _bcOffset, 62);
+  List<int>? get flex => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 64);
+  List<Test>? get test5 => const fb.ListReader<Test>(Test.reader).vTableGetNullable(_bc, _bcOffset, 66);
+  List<int>? get vectorOfLongs => const fb.ListReader<int>(fb.Int64Reader()).vTableGetNullable(_bc, _bcOffset, 68);
+  List<double>? get vectorOfDoubles => const fb.ListReader<double>(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 70);
+  my_game.InParentNamespace? get parentNamespaceTest => my_game.InParentNamespace.reader.vTableGetNullable(_bc, _bcOffset, 72);
+  List<Referrable>? get vectorOfReferrables => const fb.ListReader<Referrable>(Referrable.reader).vTableGetNullable(_bc, _bcOffset, 74);
   int get singleWeakReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 76, 0);
-  List<int> get vectorOfWeakReferences => const fb.ListReader<int>(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 78, null);
-  List<Referrable> get vectorOfStrongReferrables => const fb.ListReader<Referrable>(Referrable.reader).vTableGet(_bc, _bcOffset, 80, null);
+  List<int>? get vectorOfWeakReferences => const fb.ListReader<int>(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 78);
+  List<Referrable>? get vectorOfStrongReferrables => const fb.ListReader<Referrable>(Referrable.reader).vTableGetNullable(_bc, _bcOffset, 80);
   int get coOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 82, 0);
-  List<int> get vectorOfCoOwningReferences => const fb.ListReader<int>(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 84, null);
+  List<int>? get vectorOfCoOwningReferences => const fb.ListReader<int>(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 84);
   int get nonOwningReference => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 86, 0);
-  List<int> get vectorOfNonOwningReferences => const fb.ListReader<int>(const fb.Uint64Reader()).vTableGet(_bc, _bcOffset, 88, null);
-  AnyUniqueAliasesTypeId get anyUniqueType => new AnyUniqueAliasesTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 90, 0));
+  List<int>? get vectorOfNonOwningReferences => const fb.ListReader<int>(fb.Uint64Reader()).vTableGetNullable(_bc, _bcOffset, 88);
+  AnyUniqueAliasesTypeId? get anyUniqueType => AnyUniqueAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 90));
   dynamic get anyUnique {
     switch (anyUniqueType?.value) {
-      case 1: return Monster.reader.vTableGet(_bc, _bcOffset, 92, null);
-      case 2: return TestSimpleTableWithEnum.reader.vTableGet(_bc, _bcOffset, 92, null);
-      case 3: return my_game_example2.Monster.reader.vTableGet(_bc, _bcOffset, 92, null);
+      case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 92);
+      case 2: return TestSimpleTableWithEnum.reader.vTableGetNullable(_bc, _bcOffset, 92);
+      case 3: return my_game_example2.Monster.reader.vTableGetNullable(_bc, _bcOffset, 92);
       default: return null;
     }
   }
-  AnyAmbiguousAliasesTypeId get anyAmbiguousType => new AnyAmbiguousAliasesTypeId.fromValue(const fb.Uint8Reader().vTableGet(_bc, _bcOffset, 94, 0));
+  AnyAmbiguousAliasesTypeId? get anyAmbiguousType => AnyAmbiguousAliasesTypeId._createOrNull(const fb.Uint8Reader().vTableGetNullable(_bc, _bcOffset, 94));
   dynamic get anyAmbiguous {
     switch (anyAmbiguousType?.value) {
-      case 1: return Monster.reader.vTableGet(_bc, _bcOffset, 96, null);
-      case 2: return Monster.reader.vTableGet(_bc, _bcOffset, 96, null);
-      case 3: return Monster.reader.vTableGet(_bc, _bcOffset, 96, null);
+      case 1: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96);
+      case 2: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96);
+      case 3: return Monster.reader.vTableGetNullable(_bc, _bcOffset, 96);
       default: return null;
     }
   }
-  List<Color> get vectorOfEnums => const fb.ListReader<Color>(Color.reader).vTableGet(_bc, _bcOffset, 98, null);
-  Race get signedEnum => new Race.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 100, -1));
-  List<int> get testrequirednestedflatbuffer => const fb.ListReader<int>(const fb.Uint8Reader()).vTableGet(_bc, _bcOffset, 102, null);
+  List<Color>? get vectorOfEnums => const fb.ListReader<Color>(Color.reader).vTableGetNullable(_bc, _bcOffset, 98);
+  Race get signedEnum => Race.fromValue(const fb.Int8Reader().vTableGet(_bc, _bcOffset, 100, -1));
+  List<int>? get testrequirednestedflatbuffer => const fb.Uint8ListReader().vTableGetNullable(_bc, _bcOffset, 102);
+  List<Stat>? get scalarKeySortedTables => const fb.ListReader<Stat>(Stat.reader).vTableGetNullable(_bc, _bcOffset, 104);
+  Test? get nativeInline => Test.reader.vTableGetNullable(_bc, _bcOffset, 106);
+  LongEnum get longEnumNonEnumDefault => LongEnum.fromValue(const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 108, 0));
+  LongEnum get longEnumNormalDefault => LongEnum.fromValue(const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 110, 2));
 
   @override
   String toString() {
-    return 'Monster{pos: $pos, mana: $mana, hp: $hp, name: $name, inventory: $inventory, color: $color, testType: $testType, test: $test, test4: $test4, testarrayofstring: $testarrayofstring, testarrayoftables: $testarrayoftables, enemy: $enemy, testnestedflatbuffer: $testnestedflatbuffer, testempty: $testempty, testbool: $testbool, testhashs32Fnv1: $testhashs32Fnv1, testhashu32Fnv1: $testhashu32Fnv1, testhashs64Fnv1: $testhashs64Fnv1, testhashu64Fnv1: $testhashu64Fnv1, testhashs32Fnv1a: $testhashs32Fnv1a, testhashu32Fnv1a: $testhashu32Fnv1a, testhashs64Fnv1a: $testhashs64Fnv1a, testhashu64Fnv1a: $testhashu64Fnv1a, testarrayofbools: $testarrayofbools, testf: $testf, testf2: $testf2, testf3: $testf3, testarrayofstring2: $testarrayofstring2, testarrayofsortedstruct: $testarrayofsortedstruct, flex: $flex, test5: $test5, vectorOfLongs: $vectorOfLongs, vectorOfDoubles: $vectorOfDoubles, parentNamespaceTest: $parentNamespaceTest, vectorOfReferrables: $vectorOfReferrables, singleWeakReference: $singleWeakReference, vectorOfWeakReferences: $vectorOfWeakReferences, vectorOfStrongReferrables: $vectorOfStrongReferrables, coOwningReference: $coOwningReference, vectorOfCoOwningReferences: $vectorOfCoOwningReferences, nonOwningReference: $nonOwningReference, vectorOfNonOwningReferences: $vectorOfNonOwningReferences, anyUniqueType: $anyUniqueType, anyUnique: $anyUnique, anyAmbiguousType: $anyAmbiguousType, anyAmbiguous: $anyAmbiguous, vectorOfEnums: $vectorOfEnums, signedEnum: $signedEnum, testrequirednestedflatbuffer: $testrequirednestedflatbuffer}';
+    return 'Monster{pos: $pos, mana: $mana, hp: $hp, name: $name, inventory: $inventory, color: $color, testType: $testType, test: $test, test4: $test4, testarrayofstring: $testarrayofstring, testarrayoftables: $testarrayoftables, enemy: $enemy, testnestedflatbuffer: $testnestedflatbuffer, testempty: $testempty, testbool: $testbool, testhashs32Fnv1: $testhashs32Fnv1, testhashu32Fnv1: $testhashu32Fnv1, testhashs64Fnv1: $testhashs64Fnv1, testhashu64Fnv1: $testhashu64Fnv1, testhashs32Fnv1a: $testhashs32Fnv1a, testhashu32Fnv1a: $testhashu32Fnv1a, testhashs64Fnv1a: $testhashs64Fnv1a, testhashu64Fnv1a: $testhashu64Fnv1a, testarrayofbools: $testarrayofbools, testf: $testf, testf2: $testf2, testf3: $testf3, testarrayofstring2: $testarrayofstring2, testarrayofsortedstruct: $testarrayofsortedstruct, flex: $flex, test5: $test5, vectorOfLongs: $vectorOfLongs, vectorOfDoubles: $vectorOfDoubles, parentNamespaceTest: $parentNamespaceTest, vectorOfReferrables: $vectorOfReferrables, singleWeakReference: $singleWeakReference, vectorOfWeakReferences: $vectorOfWeakReferences, vectorOfStrongReferrables: $vectorOfStrongReferrables, coOwningReference: $coOwningReference, vectorOfCoOwningReferences: $vectorOfCoOwningReferences, nonOwningReference: $nonOwningReference, vectorOfNonOwningReferences: $vectorOfNonOwningReferences, anyUniqueType: $anyUniqueType, anyUnique: $anyUnique, anyAmbiguousType: $anyAmbiguousType, anyAmbiguous: $anyAmbiguous, vectorOfEnums: $vectorOfEnums, signedEnum: $signedEnum, testrequirednestedflatbuffer: $testrequirednestedflatbuffer, scalarKeySortedTables: $scalarKeySortedTables, nativeInline: $nativeInline, longEnumNonEnumDefault: $longEnumNonEnumDefault, longEnumNormalDefault: $longEnumNormalDefault}';
+  }
+
+  MonsterT unpack() => MonsterT(
+      pos: pos?.unpack(),
+      mana: mana,
+      hp: hp,
+      name: name,
+      inventory: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 14),
+      color: color,
+      testType: testType,
+      test: test,
+      test4: test4?.map((e) => e.unpack()).toList(),
+      testarrayofstring: const fb.ListReader<String>(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 24),
+      testarrayoftables: testarrayoftables?.map((e) => e.unpack()).toList(),
+      enemy: enemy?.unpack(),
+      testnestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 30),
+      testempty: testempty?.unpack(),
+      testbool: testbool,
+      testhashs32Fnv1: testhashs32Fnv1,
+      testhashu32Fnv1: testhashu32Fnv1,
+      testhashs64Fnv1: testhashs64Fnv1,
+      testhashu64Fnv1: testhashu64Fnv1,
+      testhashs32Fnv1a: testhashs32Fnv1a,
+      testhashu32Fnv1a: testhashu32Fnv1a,
+      testhashs64Fnv1a: testhashs64Fnv1a,
+      testhashu64Fnv1a: testhashu64Fnv1a,
+      testarrayofbools: const fb.ListReader<bool>(fb.BoolReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 52),
+      testf: testf,
+      testf2: testf2,
+      testf3: testf3,
+      testarrayofstring2: const fb.ListReader<String>(fb.StringReader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 60),
+      testarrayofsortedstruct: testarrayofsortedstruct?.map((e) => e.unpack()).toList(),
+      flex: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 64),
+      test5: test5?.map((e) => e.unpack()).toList(),
+      vectorOfLongs: const fb.ListReader<int>(fb.Int64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 68),
+      vectorOfDoubles: const fb.ListReader<double>(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 70),
+      parentNamespaceTest: parentNamespaceTest?.unpack(),
+      vectorOfReferrables: vectorOfReferrables?.map((e) => e.unpack()).toList(),
+      singleWeakReference: singleWeakReference,
+      vectorOfWeakReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 78),
+      vectorOfStrongReferrables: vectorOfStrongReferrables?.map((e) => e.unpack()).toList(),
+      coOwningReference: coOwningReference,
+      vectorOfCoOwningReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 84),
+      nonOwningReference: nonOwningReference,
+      vectorOfNonOwningReferences: const fb.ListReader<int>(fb.Uint64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 88),
+      anyUniqueType: anyUniqueType,
+      anyUnique: anyUnique,
+      anyAmbiguousType: anyAmbiguousType,
+      anyAmbiguous: anyAmbiguous,
+      vectorOfEnums: const fb.ListReader<Color>(Color.reader, lazy: false).vTableGetNullable(_bc, _bcOffset, 98),
+      signedEnum: signedEnum,
+      testrequirednestedflatbuffer: const fb.Uint8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 102),
+      scalarKeySortedTables: scalarKeySortedTables?.map((e) => e.unpack()).toList(),
+      nativeInline: nativeInline?.unpack(),
+      longEnumNonEnumDefault: longEnumNonEnumDefault,
+      longEnumNormalDefault: longEnumNormalDefault);
+
+  static int pack(fb.Builder fbBuilder, MonsterT? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+///  an example documentation comment: "monster object"
+class MonsterT implements fb.Packable {
+  Vec3T? pos;
+  int mana;
+  int hp;
+  String? name;
+  List<int>? inventory;
+  Color color;
+  AnyTypeId? testType;
+  dynamic test;
+  List<TestT>? test4;
+  List<String>? testarrayofstring;
+  ///  an example documentation comment: this will end up in the generated code
+  ///  multiline too
+  List<MonsterT>? testarrayoftables;
+  MonsterT? enemy;
+  List<int>? testnestedflatbuffer;
+  StatT? testempty;
+  bool testbool;
+  int testhashs32Fnv1;
+  int testhashu32Fnv1;
+  int testhashs64Fnv1;
+  int testhashu64Fnv1;
+  int testhashs32Fnv1a;
+  int testhashu32Fnv1a;
+  int testhashs64Fnv1a;
+  int testhashu64Fnv1a;
+  List<bool>? testarrayofbools;
+  double testf;
+  double testf2;
+  double testf3;
+  List<String>? testarrayofstring2;
+  List<AbilityT>? testarrayofsortedstruct;
+  List<int>? flex;
+  List<TestT>? test5;
+  List<int>? vectorOfLongs;
+  List<double>? vectorOfDoubles;
+  my_game.InParentNamespaceT? parentNamespaceTest;
+  List<ReferrableT>? vectorOfReferrables;
+  int singleWeakReference;
+  List<int>? vectorOfWeakReferences;
+  List<ReferrableT>? vectorOfStrongReferrables;
+  int coOwningReference;
+  List<int>? vectorOfCoOwningReferences;
+  int nonOwningReference;
+  List<int>? vectorOfNonOwningReferences;
+  AnyUniqueAliasesTypeId? anyUniqueType;
+  dynamic anyUnique;
+  AnyAmbiguousAliasesTypeId? anyAmbiguousType;
+  dynamic anyAmbiguous;
+  List<Color>? vectorOfEnums;
+  Race signedEnum;
+  List<int>? testrequirednestedflatbuffer;
+  List<StatT>? scalarKeySortedTables;
+  TestT? nativeInline;
+  LongEnum longEnumNonEnumDefault;
+  LongEnum longEnumNormalDefault;
+
+  MonsterT({
+      this.pos,
+      this.mana = 150,
+      this.hp = 100,
+      this.name,
+      this.inventory,
+      this.color = Color.Blue,
+      this.testType,
+      this.test,
+      this.test4,
+      this.testarrayofstring,
+      this.testarrayoftables,
+      this.enemy,
+      this.testnestedflatbuffer,
+      this.testempty,
+      this.testbool = false,
+      this.testhashs32Fnv1 = 0,
+      this.testhashu32Fnv1 = 0,
+      this.testhashs64Fnv1 = 0,
+      this.testhashu64Fnv1 = 0,
+      this.testhashs32Fnv1a = 0,
+      this.testhashu32Fnv1a = 0,
+      this.testhashs64Fnv1a = 0,
+      this.testhashu64Fnv1a = 0,
+      this.testarrayofbools,
+      this.testf = 3.14159,
+      this.testf2 = 3.0,
+      this.testf3 = 0.0,
+      this.testarrayofstring2,
+      this.testarrayofsortedstruct,
+      this.flex,
+      this.test5,
+      this.vectorOfLongs,
+      this.vectorOfDoubles,
+      this.parentNamespaceTest,
+      this.vectorOfReferrables,
+      this.singleWeakReference = 0,
+      this.vectorOfWeakReferences,
+      this.vectorOfStrongReferrables,
+      this.coOwningReference = 0,
+      this.vectorOfCoOwningReferences,
+      this.nonOwningReference = 0,
+      this.vectorOfNonOwningReferences,
+      this.anyUniqueType,
+      this.anyUnique,
+      this.anyAmbiguousType,
+      this.anyAmbiguous,
+      this.vectorOfEnums,
+      this.signedEnum = Race.None,
+      this.testrequirednestedflatbuffer,
+      this.scalarKeySortedTables,
+      this.nativeInline,
+      this.longEnumNonEnumDefault = const LongEnum._(0),
+      this.longEnumNormalDefault = LongEnum.LongOne});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    final int? nameOffset = name == null ? null
+        : fbBuilder.writeString(name!);
+    final int? inventoryOffset = inventory == null ? null
+        : fbBuilder.writeListUint8(inventory!);
+    final int? testOffset = test?.pack(fbBuilder);
+    int? test4Offset;
+    if (test4 != null) {
+      for (var e in test4!) { e.pack(fbBuilder); }
+      test4Offset = fbBuilder.endStructVector(test4!.length);
+    }
+    final int? testarrayofstringOffset = testarrayofstring == null ? null
+        : fbBuilder.writeList(testarrayofstring!.map(fbBuilder.writeString).toList());
+    final int? testarrayoftablesOffset = testarrayoftables == null ? null
+        : fbBuilder.writeList(testarrayoftables!.map((b) => b.pack(fbBuilder)).toList());
+    final int? enemyOffset = enemy?.pack(fbBuilder);
+    final int? testnestedflatbufferOffset = testnestedflatbuffer == null ? null
+        : fbBuilder.writeListUint8(testnestedflatbuffer!);
+    final int? testemptyOffset = testempty?.pack(fbBuilder);
+    final int? testarrayofboolsOffset = testarrayofbools == null ? null
+        : fbBuilder.writeListBool(testarrayofbools!);
+    final int? testarrayofstring2Offset = testarrayofstring2 == null ? null
+        : fbBuilder.writeList(testarrayofstring2!.map(fbBuilder.writeString).toList());
+    int? testarrayofsortedstructOffset;
+    if (testarrayofsortedstruct != null) {
+      for (var e in testarrayofsortedstruct!) { e.pack(fbBuilder); }
+      testarrayofsortedstructOffset = fbBuilder.endStructVector(testarrayofsortedstruct!.length);
+    }
+    final int? flexOffset = flex == null ? null
+        : fbBuilder.writeListUint8(flex!);
+    int? test5Offset;
+    if (test5 != null) {
+      for (var e in test5!) { e.pack(fbBuilder); }
+      test5Offset = fbBuilder.endStructVector(test5!.length);
+    }
+    final int? vectorOfLongsOffset = vectorOfLongs == null ? null
+        : fbBuilder.writeListInt64(vectorOfLongs!);
+    final int? vectorOfDoublesOffset = vectorOfDoubles == null ? null
+        : fbBuilder.writeListFloat64(vectorOfDoubles!);
+    final int? parentNamespaceTestOffset = parentNamespaceTest?.pack(fbBuilder);
+    final int? vectorOfReferrablesOffset = vectorOfReferrables == null ? null
+        : fbBuilder.writeList(vectorOfReferrables!.map((b) => b.pack(fbBuilder)).toList());
+    final int? vectorOfWeakReferencesOffset = vectorOfWeakReferences == null ? null
+        : fbBuilder.writeListUint64(vectorOfWeakReferences!);
+    final int? vectorOfStrongReferrablesOffset = vectorOfStrongReferrables == null ? null
+        : fbBuilder.writeList(vectorOfStrongReferrables!.map((b) => b.pack(fbBuilder)).toList());
+    final int? vectorOfCoOwningReferencesOffset = vectorOfCoOwningReferences == null ? null
+        : fbBuilder.writeListUint64(vectorOfCoOwningReferences!);
+    final int? vectorOfNonOwningReferencesOffset = vectorOfNonOwningReferences == null ? null
+        : fbBuilder.writeListUint64(vectorOfNonOwningReferences!);
+    final int? anyUniqueOffset = anyUnique?.pack(fbBuilder);
+    final int? anyAmbiguousOffset = anyAmbiguous?.pack(fbBuilder);
+    final int? vectorOfEnumsOffset = vectorOfEnums == null ? null
+        : fbBuilder.writeListUint8(vectorOfEnums!.map((f) => f.value).toList());
+    final int? testrequirednestedflatbufferOffset = testrequirednestedflatbuffer == null ? null
+        : fbBuilder.writeListUint8(testrequirednestedflatbuffer!);
+    final int? scalarKeySortedTablesOffset = scalarKeySortedTables == null ? null
+        : fbBuilder.writeList(scalarKeySortedTables!.map((b) => b.pack(fbBuilder)).toList());
+    fbBuilder.startTable(54);
+    if (pos != null) {
+      fbBuilder.addStruct(0, pos!.pack(fbBuilder));
+    }
+    fbBuilder.addInt16(1, mana);
+    fbBuilder.addInt16(2, hp);
+    fbBuilder.addOffset(3, nameOffset);
+    fbBuilder.addOffset(5, inventoryOffset);
+    fbBuilder.addUint8(6, color.value);
+    fbBuilder.addUint8(7, testType?.value);
+    fbBuilder.addOffset(8, testOffset);
+    fbBuilder.addOffset(9, test4Offset);
+    fbBuilder.addOffset(10, testarrayofstringOffset);
+    fbBuilder.addOffset(11, testarrayoftablesOffset);
+    fbBuilder.addOffset(12, enemyOffset);
+    fbBuilder.addOffset(13, testnestedflatbufferOffset);
+    fbBuilder.addOffset(14, testemptyOffset);
+    fbBuilder.addBool(15, testbool);
+    fbBuilder.addInt32(16, testhashs32Fnv1);
+    fbBuilder.addUint32(17, testhashu32Fnv1);
+    fbBuilder.addInt64(18, testhashs64Fnv1);
+    fbBuilder.addUint64(19, testhashu64Fnv1);
+    fbBuilder.addInt32(20, testhashs32Fnv1a);
+    fbBuilder.addUint32(21, testhashu32Fnv1a);
+    fbBuilder.addInt64(22, testhashs64Fnv1a);
+    fbBuilder.addUint64(23, testhashu64Fnv1a);
+    fbBuilder.addOffset(24, testarrayofboolsOffset);
+    fbBuilder.addFloat32(25, testf);
+    fbBuilder.addFloat32(26, testf2);
+    fbBuilder.addFloat32(27, testf3);
+    fbBuilder.addOffset(28, testarrayofstring2Offset);
+    fbBuilder.addOffset(29, testarrayofsortedstructOffset);
+    fbBuilder.addOffset(30, flexOffset);
+    fbBuilder.addOffset(31, test5Offset);
+    fbBuilder.addOffset(32, vectorOfLongsOffset);
+    fbBuilder.addOffset(33, vectorOfDoublesOffset);
+    fbBuilder.addOffset(34, parentNamespaceTestOffset);
+    fbBuilder.addOffset(35, vectorOfReferrablesOffset);
+    fbBuilder.addUint64(36, singleWeakReference);
+    fbBuilder.addOffset(37, vectorOfWeakReferencesOffset);
+    fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset);
+    fbBuilder.addUint64(39, coOwningReference);
+    fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset);
+    fbBuilder.addUint64(41, nonOwningReference);
+    fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset);
+    fbBuilder.addUint8(43, anyUniqueType?.value);
+    fbBuilder.addOffset(44, anyUniqueOffset);
+    fbBuilder.addUint8(45, anyAmbiguousType?.value);
+    fbBuilder.addOffset(46, anyAmbiguousOffset);
+    fbBuilder.addOffset(47, vectorOfEnumsOffset);
+    fbBuilder.addInt8(48, signedEnum.value);
+    fbBuilder.addOffset(49, testrequirednestedflatbufferOffset);
+    fbBuilder.addOffset(50, scalarKeySortedTablesOffset);
+    if (nativeInline != null) {
+      fbBuilder.addStruct(51, nativeInline!.pack(fbBuilder));
+    }
+    fbBuilder.addUint64(52, longEnumNonEnumDefault.value);
+    fbBuilder.addUint64(53, longEnumNormalDefault.value);
+    return fbBuilder.endTable();
+  }
+
+  @override
+  String toString() {
+    return 'MonsterT{pos: $pos, mana: $mana, hp: $hp, name: $name, inventory: $inventory, color: $color, testType: $testType, test: $test, test4: $test4, testarrayofstring: $testarrayofstring, testarrayoftables: $testarrayoftables, enemy: $enemy, testnestedflatbuffer: $testnestedflatbuffer, testempty: $testempty, testbool: $testbool, testhashs32Fnv1: $testhashs32Fnv1, testhashu32Fnv1: $testhashu32Fnv1, testhashs64Fnv1: $testhashs64Fnv1, testhashu64Fnv1: $testhashu64Fnv1, testhashs32Fnv1a: $testhashs32Fnv1a, testhashu32Fnv1a: $testhashu32Fnv1a, testhashs64Fnv1a: $testhashs64Fnv1a, testhashu64Fnv1a: $testhashu64Fnv1a, testarrayofbools: $testarrayofbools, testf: $testf, testf2: $testf2, testf3: $testf3, testarrayofstring2: $testarrayofstring2, testarrayofsortedstruct: $testarrayofsortedstruct, flex: $flex, test5: $test5, vectorOfLongs: $vectorOfLongs, vectorOfDoubles: $vectorOfDoubles, parentNamespaceTest: $parentNamespaceTest, vectorOfReferrables: $vectorOfReferrables, singleWeakReference: $singleWeakReference, vectorOfWeakReferences: $vectorOfWeakReferences, vectorOfStrongReferrables: $vectorOfStrongReferrables, coOwningReference: $coOwningReference, vectorOfCoOwningReferences: $vectorOfCoOwningReferences, nonOwningReference: $nonOwningReference, vectorOfNonOwningReferences: $vectorOfNonOwningReferences, anyUniqueType: $anyUniqueType, anyUnique: $anyUnique, anyAmbiguousType: $anyAmbiguousType, anyAmbiguous: $anyAmbiguous, vectorOfEnums: $vectorOfEnums, signedEnum: $signedEnum, testrequirednestedflatbuffer: $testrequirednestedflatbuffer, scalarKeySortedTables: $scalarKeySortedTables, nativeInline: $nativeInline, longEnumNonEnumDefault: $longEnumNonEnumDefault, longEnumNormalDefault: $longEnumNormalDefault}';
   }
 }
 
@@ -814,216 +1481,230 @@
 
   @override
   Monster createObject(fb.BufferContext bc, int offset) => 
-    new Monster._(bc, offset);
+    Monster._(bc, offset);
 }
 
 class MonsterBuilder {
-  MonsterBuilder(this.fbBuilder) {
-    assert(fbBuilder != null);
-  }
+  MonsterBuilder(this.fbBuilder);
 
   final fb.Builder fbBuilder;
 
   void begin() {
-    fbBuilder.startTable();
+    fbBuilder.startTable(54);
   }
 
   int addPos(int offset) {
     fbBuilder.addStruct(0, offset);
     return fbBuilder.offset;
   }
-  int addMana(int mana) {
+  int addMana(int? mana) {
     fbBuilder.addInt16(1, mana);
     return fbBuilder.offset;
   }
-  int addHp(int hp) {
+  int addHp(int? hp) {
     fbBuilder.addInt16(2, hp);
     return fbBuilder.offset;
   }
-  int addNameOffset(int offset) {
+  int addNameOffset(int? offset) {
     fbBuilder.addOffset(3, offset);
     return fbBuilder.offset;
   }
-  int addInventoryOffset(int offset) {
+  int addInventoryOffset(int? offset) {
     fbBuilder.addOffset(5, offset);
     return fbBuilder.offset;
   }
-  int addColor(Color color) {
+  int addColor(Color? color) {
     fbBuilder.addUint8(6, color?.value);
     return fbBuilder.offset;
   }
-  int addTestType(AnyTypeId testType) {
+  int addTestType(AnyTypeId? testType) {
     fbBuilder.addUint8(7, testType?.value);
     return fbBuilder.offset;
   }
-  int addTestOffset(int offset) {
+  int addTestOffset(int? offset) {
     fbBuilder.addOffset(8, offset);
     return fbBuilder.offset;
   }
-  int addTest4Offset(int offset) {
+  int addTest4Offset(int? offset) {
     fbBuilder.addOffset(9, offset);
     return fbBuilder.offset;
   }
-  int addTestarrayofstringOffset(int offset) {
+  int addTestarrayofstringOffset(int? offset) {
     fbBuilder.addOffset(10, offset);
     return fbBuilder.offset;
   }
-  int addTestarrayoftablesOffset(int offset) {
+  int addTestarrayoftablesOffset(int? offset) {
     fbBuilder.addOffset(11, offset);
     return fbBuilder.offset;
   }
-  int addEnemyOffset(int offset) {
+  int addEnemyOffset(int? offset) {
     fbBuilder.addOffset(12, offset);
     return fbBuilder.offset;
   }
-  int addTestnestedflatbufferOffset(int offset) {
+  int addTestnestedflatbufferOffset(int? offset) {
     fbBuilder.addOffset(13, offset);
     return fbBuilder.offset;
   }
-  int addTestemptyOffset(int offset) {
+  int addTestemptyOffset(int? offset) {
     fbBuilder.addOffset(14, offset);
     return fbBuilder.offset;
   }
-  int addTestbool(bool testbool) {
+  int addTestbool(bool? testbool) {
     fbBuilder.addBool(15, testbool);
     return fbBuilder.offset;
   }
-  int addTesthashs32Fnv1(int testhashs32Fnv1) {
+  int addTesthashs32Fnv1(int? testhashs32Fnv1) {
     fbBuilder.addInt32(16, testhashs32Fnv1);
     return fbBuilder.offset;
   }
-  int addTesthashu32Fnv1(int testhashu32Fnv1) {
+  int addTesthashu32Fnv1(int? testhashu32Fnv1) {
     fbBuilder.addUint32(17, testhashu32Fnv1);
     return fbBuilder.offset;
   }
-  int addTesthashs64Fnv1(int testhashs64Fnv1) {
+  int addTesthashs64Fnv1(int? testhashs64Fnv1) {
     fbBuilder.addInt64(18, testhashs64Fnv1);
     return fbBuilder.offset;
   }
-  int addTesthashu64Fnv1(int testhashu64Fnv1) {
+  int addTesthashu64Fnv1(int? testhashu64Fnv1) {
     fbBuilder.addUint64(19, testhashu64Fnv1);
     return fbBuilder.offset;
   }
-  int addTesthashs32Fnv1a(int testhashs32Fnv1a) {
+  int addTesthashs32Fnv1a(int? testhashs32Fnv1a) {
     fbBuilder.addInt32(20, testhashs32Fnv1a);
     return fbBuilder.offset;
   }
-  int addTesthashu32Fnv1a(int testhashu32Fnv1a) {
+  int addTesthashu32Fnv1a(int? testhashu32Fnv1a) {
     fbBuilder.addUint32(21, testhashu32Fnv1a);
     return fbBuilder.offset;
   }
-  int addTesthashs64Fnv1a(int testhashs64Fnv1a) {
+  int addTesthashs64Fnv1a(int? testhashs64Fnv1a) {
     fbBuilder.addInt64(22, testhashs64Fnv1a);
     return fbBuilder.offset;
   }
-  int addTesthashu64Fnv1a(int testhashu64Fnv1a) {
+  int addTesthashu64Fnv1a(int? testhashu64Fnv1a) {
     fbBuilder.addUint64(23, testhashu64Fnv1a);
     return fbBuilder.offset;
   }
-  int addTestarrayofboolsOffset(int offset) {
+  int addTestarrayofboolsOffset(int? offset) {
     fbBuilder.addOffset(24, offset);
     return fbBuilder.offset;
   }
-  int addTestf(double testf) {
+  int addTestf(double? testf) {
     fbBuilder.addFloat32(25, testf);
     return fbBuilder.offset;
   }
-  int addTestf2(double testf2) {
+  int addTestf2(double? testf2) {
     fbBuilder.addFloat32(26, testf2);
     return fbBuilder.offset;
   }
-  int addTestf3(double testf3) {
+  int addTestf3(double? testf3) {
     fbBuilder.addFloat32(27, testf3);
     return fbBuilder.offset;
   }
-  int addTestarrayofstring2Offset(int offset) {
+  int addTestarrayofstring2Offset(int? offset) {
     fbBuilder.addOffset(28, offset);
     return fbBuilder.offset;
   }
-  int addTestarrayofsortedstructOffset(int offset) {
+  int addTestarrayofsortedstructOffset(int? offset) {
     fbBuilder.addOffset(29, offset);
     return fbBuilder.offset;
   }
-  int addFlexOffset(int offset) {
+  int addFlexOffset(int? offset) {
     fbBuilder.addOffset(30, offset);
     return fbBuilder.offset;
   }
-  int addTest5Offset(int offset) {
+  int addTest5Offset(int? offset) {
     fbBuilder.addOffset(31, offset);
     return fbBuilder.offset;
   }
-  int addVectorOfLongsOffset(int offset) {
+  int addVectorOfLongsOffset(int? offset) {
     fbBuilder.addOffset(32, offset);
     return fbBuilder.offset;
   }
-  int addVectorOfDoublesOffset(int offset) {
+  int addVectorOfDoublesOffset(int? offset) {
     fbBuilder.addOffset(33, offset);
     return fbBuilder.offset;
   }
-  int addParentNamespaceTestOffset(int offset) {
+  int addParentNamespaceTestOffset(int? offset) {
     fbBuilder.addOffset(34, offset);
     return fbBuilder.offset;
   }
-  int addVectorOfReferrablesOffset(int offset) {
+  int addVectorOfReferrablesOffset(int? offset) {
     fbBuilder.addOffset(35, offset);
     return fbBuilder.offset;
   }
-  int addSingleWeakReference(int singleWeakReference) {
+  int addSingleWeakReference(int? singleWeakReference) {
     fbBuilder.addUint64(36, singleWeakReference);
     return fbBuilder.offset;
   }
-  int addVectorOfWeakReferencesOffset(int offset) {
+  int addVectorOfWeakReferencesOffset(int? offset) {
     fbBuilder.addOffset(37, offset);
     return fbBuilder.offset;
   }
-  int addVectorOfStrongReferrablesOffset(int offset) {
+  int addVectorOfStrongReferrablesOffset(int? offset) {
     fbBuilder.addOffset(38, offset);
     return fbBuilder.offset;
   }
-  int addCoOwningReference(int coOwningReference) {
+  int addCoOwningReference(int? coOwningReference) {
     fbBuilder.addUint64(39, coOwningReference);
     return fbBuilder.offset;
   }
-  int addVectorOfCoOwningReferencesOffset(int offset) {
+  int addVectorOfCoOwningReferencesOffset(int? offset) {
     fbBuilder.addOffset(40, offset);
     return fbBuilder.offset;
   }
-  int addNonOwningReference(int nonOwningReference) {
+  int addNonOwningReference(int? nonOwningReference) {
     fbBuilder.addUint64(41, nonOwningReference);
     return fbBuilder.offset;
   }
-  int addVectorOfNonOwningReferencesOffset(int offset) {
+  int addVectorOfNonOwningReferencesOffset(int? offset) {
     fbBuilder.addOffset(42, offset);
     return fbBuilder.offset;
   }
-  int addAnyUniqueType(AnyUniqueAliasesTypeId anyUniqueType) {
+  int addAnyUniqueType(AnyUniqueAliasesTypeId? anyUniqueType) {
     fbBuilder.addUint8(43, anyUniqueType?.value);
     return fbBuilder.offset;
   }
-  int addAnyUniqueOffset(int offset) {
+  int addAnyUniqueOffset(int? offset) {
     fbBuilder.addOffset(44, offset);
     return fbBuilder.offset;
   }
-  int addAnyAmbiguousType(AnyAmbiguousAliasesTypeId anyAmbiguousType) {
+  int addAnyAmbiguousType(AnyAmbiguousAliasesTypeId? anyAmbiguousType) {
     fbBuilder.addUint8(45, anyAmbiguousType?.value);
     return fbBuilder.offset;
   }
-  int addAnyAmbiguousOffset(int offset) {
+  int addAnyAmbiguousOffset(int? offset) {
     fbBuilder.addOffset(46, offset);
     return fbBuilder.offset;
   }
-  int addVectorOfEnumsOffset(int offset) {
+  int addVectorOfEnumsOffset(int? offset) {
     fbBuilder.addOffset(47, offset);
     return fbBuilder.offset;
   }
-  int addSignedEnum(Race signedEnum) {
+  int addSignedEnum(Race? signedEnum) {
     fbBuilder.addInt8(48, signedEnum?.value);
     return fbBuilder.offset;
   }
-  int addTestrequirednestedflatbufferOffset(int offset) {
+  int addTestrequirednestedflatbufferOffset(int? offset) {
     fbBuilder.addOffset(49, offset);
     return fbBuilder.offset;
   }
+  int addScalarKeySortedTablesOffset(int? offset) {
+    fbBuilder.addOffset(50, offset);
+    return fbBuilder.offset;
+  }
+  int addNativeInline(int offset) {
+    fbBuilder.addStruct(51, offset);
+    return fbBuilder.offset;
+  }
+  int addLongEnumNonEnumDefault(LongEnum? longEnumNonEnumDefault) {
+    fbBuilder.addUint64(52, longEnumNonEnumDefault?.value);
+    return fbBuilder.offset;
+  }
+  int addLongEnumNormalDefault(LongEnum? longEnumNormalDefault) {
+    fbBuilder.addUint64(53, longEnumNormalDefault?.value);
+    return fbBuilder.offset;
+  }
 
   int finish() {
     return fbBuilder.endTable();
@@ -1031,106 +1712,114 @@
 }
 
 class MonsterObjectBuilder extends fb.ObjectBuilder {
-  final Vec3ObjectBuilder _pos;
-  final int _mana;
-  final int _hp;
-  final String _name;
-  final List<int> _inventory;
-  final Color _color;
-  final AnyTypeId _testType;
+  final Vec3ObjectBuilder? _pos;
+  final int? _mana;
+  final int? _hp;
+  final String? _name;
+  final List<int>? _inventory;
+  final Color? _color;
+  final AnyTypeId? _testType;
   final dynamic _test;
-  final List<TestObjectBuilder> _test4;
-  final List<String> _testarrayofstring;
-  final List<MonsterObjectBuilder> _testarrayoftables;
-  final MonsterObjectBuilder _enemy;
-  final List<int> _testnestedflatbuffer;
-  final StatObjectBuilder _testempty;
-  final bool _testbool;
-  final int _testhashs32Fnv1;
-  final int _testhashu32Fnv1;
-  final int _testhashs64Fnv1;
-  final int _testhashu64Fnv1;
-  final int _testhashs32Fnv1a;
-  final int _testhashu32Fnv1a;
-  final int _testhashs64Fnv1a;
-  final int _testhashu64Fnv1a;
-  final List<bool> _testarrayofbools;
-  final double _testf;
-  final double _testf2;
-  final double _testf3;
-  final List<String> _testarrayofstring2;
-  final List<AbilityObjectBuilder> _testarrayofsortedstruct;
-  final List<int> _flex;
-  final List<TestObjectBuilder> _test5;
-  final List<int> _vectorOfLongs;
-  final List<double> _vectorOfDoubles;
-  final my_game.InParentNamespaceObjectBuilder _parentNamespaceTest;
-  final List<ReferrableObjectBuilder> _vectorOfReferrables;
-  final int _singleWeakReference;
-  final List<int> _vectorOfWeakReferences;
-  final List<ReferrableObjectBuilder> _vectorOfStrongReferrables;
-  final int _coOwningReference;
-  final List<int> _vectorOfCoOwningReferences;
-  final int _nonOwningReference;
-  final List<int> _vectorOfNonOwningReferences;
-  final AnyUniqueAliasesTypeId _anyUniqueType;
+  final List<TestObjectBuilder>? _test4;
+  final List<String>? _testarrayofstring;
+  final List<MonsterObjectBuilder>? _testarrayoftables;
+  final MonsterObjectBuilder? _enemy;
+  final List<int>? _testnestedflatbuffer;
+  final StatObjectBuilder? _testempty;
+  final bool? _testbool;
+  final int? _testhashs32Fnv1;
+  final int? _testhashu32Fnv1;
+  final int? _testhashs64Fnv1;
+  final int? _testhashu64Fnv1;
+  final int? _testhashs32Fnv1a;
+  final int? _testhashu32Fnv1a;
+  final int? _testhashs64Fnv1a;
+  final int? _testhashu64Fnv1a;
+  final List<bool>? _testarrayofbools;
+  final double? _testf;
+  final double? _testf2;
+  final double? _testf3;
+  final List<String>? _testarrayofstring2;
+  final List<AbilityObjectBuilder>? _testarrayofsortedstruct;
+  final List<int>? _flex;
+  final List<TestObjectBuilder>? _test5;
+  final List<int>? _vectorOfLongs;
+  final List<double>? _vectorOfDoubles;
+  final my_game.InParentNamespaceObjectBuilder? _parentNamespaceTest;
+  final List<ReferrableObjectBuilder>? _vectorOfReferrables;
+  final int? _singleWeakReference;
+  final List<int>? _vectorOfWeakReferences;
+  final List<ReferrableObjectBuilder>? _vectorOfStrongReferrables;
+  final int? _coOwningReference;
+  final List<int>? _vectorOfCoOwningReferences;
+  final int? _nonOwningReference;
+  final List<int>? _vectorOfNonOwningReferences;
+  final AnyUniqueAliasesTypeId? _anyUniqueType;
   final dynamic _anyUnique;
-  final AnyAmbiguousAliasesTypeId _anyAmbiguousType;
+  final AnyAmbiguousAliasesTypeId? _anyAmbiguousType;
   final dynamic _anyAmbiguous;
-  final List<Color> _vectorOfEnums;
-  final Race _signedEnum;
-  final List<int> _testrequirednestedflatbuffer;
+  final List<Color>? _vectorOfEnums;
+  final Race? _signedEnum;
+  final List<int>? _testrequirednestedflatbuffer;
+  final List<StatObjectBuilder>? _scalarKeySortedTables;
+  final TestObjectBuilder? _nativeInline;
+  final LongEnum? _longEnumNonEnumDefault;
+  final LongEnum? _longEnumNormalDefault;
 
   MonsterObjectBuilder({
-    Vec3ObjectBuilder pos,
-    int mana,
-    int hp,
-    String name,
-    List<int> inventory,
-    Color color,
-    AnyTypeId testType,
+    Vec3ObjectBuilder? pos,
+    int? mana,
+    int? hp,
+    String? name,
+    List<int>? inventory,
+    Color? color,
+    AnyTypeId? testType,
     dynamic test,
-    List<TestObjectBuilder> test4,
-    List<String> testarrayofstring,
-    List<MonsterObjectBuilder> testarrayoftables,
-    MonsterObjectBuilder enemy,
-    List<int> testnestedflatbuffer,
-    StatObjectBuilder testempty,
-    bool testbool,
-    int testhashs32Fnv1,
-    int testhashu32Fnv1,
-    int testhashs64Fnv1,
-    int testhashu64Fnv1,
-    int testhashs32Fnv1a,
-    int testhashu32Fnv1a,
-    int testhashs64Fnv1a,
-    int testhashu64Fnv1a,
-    List<bool> testarrayofbools,
-    double testf,
-    double testf2,
-    double testf3,
-    List<String> testarrayofstring2,
-    List<AbilityObjectBuilder> testarrayofsortedstruct,
-    List<int> flex,
-    List<TestObjectBuilder> test5,
-    List<int> vectorOfLongs,
-    List<double> vectorOfDoubles,
-    my_game.InParentNamespaceObjectBuilder parentNamespaceTest,
-    List<ReferrableObjectBuilder> vectorOfReferrables,
-    int singleWeakReference,
-    List<int> vectorOfWeakReferences,
-    List<ReferrableObjectBuilder> vectorOfStrongReferrables,
-    int coOwningReference,
-    List<int> vectorOfCoOwningReferences,
-    int nonOwningReference,
-    List<int> vectorOfNonOwningReferences,
-    AnyUniqueAliasesTypeId anyUniqueType,
+    List<TestObjectBuilder>? test4,
+    List<String>? testarrayofstring,
+    List<MonsterObjectBuilder>? testarrayoftables,
+    MonsterObjectBuilder? enemy,
+    List<int>? testnestedflatbuffer,
+    StatObjectBuilder? testempty,
+    bool? testbool,
+    int? testhashs32Fnv1,
+    int? testhashu32Fnv1,
+    int? testhashs64Fnv1,
+    int? testhashu64Fnv1,
+    int? testhashs32Fnv1a,
+    int? testhashu32Fnv1a,
+    int? testhashs64Fnv1a,
+    int? testhashu64Fnv1a,
+    List<bool>? testarrayofbools,
+    double? testf,
+    double? testf2,
+    double? testf3,
+    List<String>? testarrayofstring2,
+    List<AbilityObjectBuilder>? testarrayofsortedstruct,
+    List<int>? flex,
+    List<TestObjectBuilder>? test5,
+    List<int>? vectorOfLongs,
+    List<double>? vectorOfDoubles,
+    my_game.InParentNamespaceObjectBuilder? parentNamespaceTest,
+    List<ReferrableObjectBuilder>? vectorOfReferrables,
+    int? singleWeakReference,
+    List<int>? vectorOfWeakReferences,
+    List<ReferrableObjectBuilder>? vectorOfStrongReferrables,
+    int? coOwningReference,
+    List<int>? vectorOfCoOwningReferences,
+    int? nonOwningReference,
+    List<int>? vectorOfNonOwningReferences,
+    AnyUniqueAliasesTypeId? anyUniqueType,
     dynamic anyUnique,
-    AnyAmbiguousAliasesTypeId anyAmbiguousType,
+    AnyAmbiguousAliasesTypeId? anyAmbiguousType,
     dynamic anyAmbiguous,
-    List<Color> vectorOfEnums,
-    Race signedEnum,
-    List<int> testrequirednestedflatbuffer,
+    List<Color>? vectorOfEnums,
+    Race? signedEnum,
+    List<int>? testrequirednestedflatbuffer,
+    List<StatObjectBuilder>? scalarKeySortedTables,
+    TestObjectBuilder? nativeInline,
+    LongEnum? longEnumNonEnumDefault,
+    LongEnum? longEnumNormalDefault,
   })
       : _pos = pos,
         _mana = mana,
@@ -1180,113 +1869,80 @@
         _anyAmbiguous = anyAmbiguous,
         _vectorOfEnums = vectorOfEnums,
         _signedEnum = signedEnum,
-        _testrequirednestedflatbuffer = testrequirednestedflatbuffer;
+        _testrequirednestedflatbuffer = testrequirednestedflatbuffer,
+        _scalarKeySortedTables = scalarKeySortedTables,
+        _nativeInline = nativeInline,
+        _longEnumNonEnumDefault = longEnumNonEnumDefault,
+        _longEnumNormalDefault = longEnumNormalDefault;
 
   /// Finish building, and store into the [fbBuilder].
   @override
-  int finish(
-    fb.Builder fbBuilder) {
-    assert(fbBuilder != null);
-    final int nameOffset = fbBuilder.writeString(_name);
-    final int inventoryOffset = _inventory?.isNotEmpty == true
-        ? fbBuilder.writeListUint8(_inventory)
-        : null;
-    final int testOffset = _test?.getOrCreateOffset(fbBuilder);
-    final int test4Offset = _test4?.isNotEmpty == true
-        ? fbBuilder.writeListOfStructs(_test4)
-        : null;
-    final int testarrayofstringOffset = _testarrayofstring?.isNotEmpty == true
-        ? fbBuilder.writeList(_testarrayofstring.map((b) => fbBuilder.writeString(b)).toList())
-        : null;
-    final int testarrayoftablesOffset = _testarrayoftables?.isNotEmpty == true
-        ? fbBuilder.writeList(_testarrayoftables.map((b) => b.getOrCreateOffset(fbBuilder)).toList())
-        : null;
-    final int enemyOffset = _enemy?.getOrCreateOffset(fbBuilder);
-    final int testnestedflatbufferOffset = _testnestedflatbuffer?.isNotEmpty == true
-        ? fbBuilder.writeListUint8(_testnestedflatbuffer)
-        : null;
-    final int testemptyOffset = _testempty?.getOrCreateOffset(fbBuilder);
-    final int testarrayofboolsOffset = _testarrayofbools?.isNotEmpty == true
-        ? fbBuilder.writeListBool(_testarrayofbools)
-        : null;
-    final int testarrayofstring2Offset = _testarrayofstring2?.isNotEmpty == true
-        ? fbBuilder.writeList(_testarrayofstring2.map((b) => fbBuilder.writeString(b)).toList())
-        : null;
-    final int testarrayofsortedstructOffset = _testarrayofsortedstruct?.isNotEmpty == true
-        ? fbBuilder.writeListOfStructs(_testarrayofsortedstruct)
-        : null;
-    final int flexOffset = _flex?.isNotEmpty == true
-        ? fbBuilder.writeListUint8(_flex)
-        : null;
-    final int test5Offset = _test5?.isNotEmpty == true
-        ? fbBuilder.writeListOfStructs(_test5)
-        : null;
-    final int vectorOfLongsOffset = _vectorOfLongs?.isNotEmpty == true
-        ? fbBuilder.writeListInt64(_vectorOfLongs)
-        : null;
-    final int vectorOfDoublesOffset = _vectorOfDoubles?.isNotEmpty == true
-        ? fbBuilder.writeListFloat64(_vectorOfDoubles)
-        : null;
-    final int parentNamespaceTestOffset = _parentNamespaceTest?.getOrCreateOffset(fbBuilder);
-    final int vectorOfReferrablesOffset = _vectorOfReferrables?.isNotEmpty == true
-        ? fbBuilder.writeList(_vectorOfReferrables.map((b) => b.getOrCreateOffset(fbBuilder)).toList())
-        : null;
-    final int vectorOfWeakReferencesOffset = _vectorOfWeakReferences?.isNotEmpty == true
-        ? fbBuilder.writeListUint64(_vectorOfWeakReferences)
-        : null;
-    final int vectorOfStrongReferrablesOffset = _vectorOfStrongReferrables?.isNotEmpty == true
-        ? fbBuilder.writeList(_vectorOfStrongReferrables.map((b) => b.getOrCreateOffset(fbBuilder)).toList())
-        : null;
-    final int vectorOfCoOwningReferencesOffset = _vectorOfCoOwningReferences?.isNotEmpty == true
-        ? fbBuilder.writeListUint64(_vectorOfCoOwningReferences)
-        : null;
-    final int vectorOfNonOwningReferencesOffset = _vectorOfNonOwningReferences?.isNotEmpty == true
-        ? fbBuilder.writeListUint64(_vectorOfNonOwningReferences)
-        : null;
-    final int anyUniqueOffset = _anyUnique?.getOrCreateOffset(fbBuilder);
-    final int anyAmbiguousOffset = _anyAmbiguous?.getOrCreateOffset(fbBuilder);
-    final int vectorOfEnumsOffset = _vectorOfEnums?.isNotEmpty == true
-        ? fbBuilder.writeListUint8(_vectorOfEnums.map((f) => f.value))
-        : null;
-    final int testrequirednestedflatbufferOffset = _testrequirednestedflatbuffer?.isNotEmpty == true
-        ? fbBuilder.writeListUint8(_testrequirednestedflatbuffer)
-        : null;
-
-    fbBuilder.startTable();
+  int finish(fb.Builder fbBuilder) {
+    final int? nameOffset = _name == null ? null
+        : fbBuilder.writeString(_name!);
+    final int? inventoryOffset = _inventory == null ? null
+        : fbBuilder.writeListUint8(_inventory!);
+    final int? testOffset = _test?.getOrCreateOffset(fbBuilder);
+    final int? test4Offset = _test4 == null ? null
+        : fbBuilder.writeListOfStructs(_test4!);
+    final int? testarrayofstringOffset = _testarrayofstring == null ? null
+        : fbBuilder.writeList(_testarrayofstring!.map(fbBuilder.writeString).toList());
+    final int? testarrayoftablesOffset = _testarrayoftables == null ? null
+        : fbBuilder.writeList(_testarrayoftables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
+    final int? enemyOffset = _enemy?.getOrCreateOffset(fbBuilder);
+    final int? testnestedflatbufferOffset = _testnestedflatbuffer == null ? null
+        : fbBuilder.writeListUint8(_testnestedflatbuffer!);
+    final int? testemptyOffset = _testempty?.getOrCreateOffset(fbBuilder);
+    final int? testarrayofboolsOffset = _testarrayofbools == null ? null
+        : fbBuilder.writeListBool(_testarrayofbools!);
+    final int? testarrayofstring2Offset = _testarrayofstring2 == null ? null
+        : fbBuilder.writeList(_testarrayofstring2!.map(fbBuilder.writeString).toList());
+    final int? testarrayofsortedstructOffset = _testarrayofsortedstruct == null ? null
+        : fbBuilder.writeListOfStructs(_testarrayofsortedstruct!);
+    final int? flexOffset = _flex == null ? null
+        : fbBuilder.writeListUint8(_flex!);
+    final int? test5Offset = _test5 == null ? null
+        : fbBuilder.writeListOfStructs(_test5!);
+    final int? vectorOfLongsOffset = _vectorOfLongs == null ? null
+        : fbBuilder.writeListInt64(_vectorOfLongs!);
+    final int? vectorOfDoublesOffset = _vectorOfDoubles == null ? null
+        : fbBuilder.writeListFloat64(_vectorOfDoubles!);
+    final int? parentNamespaceTestOffset = _parentNamespaceTest?.getOrCreateOffset(fbBuilder);
+    final int? vectorOfReferrablesOffset = _vectorOfReferrables == null ? null
+        : fbBuilder.writeList(_vectorOfReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
+    final int? vectorOfWeakReferencesOffset = _vectorOfWeakReferences == null ? null
+        : fbBuilder.writeListUint64(_vectorOfWeakReferences!);
+    final int? vectorOfStrongReferrablesOffset = _vectorOfStrongReferrables == null ? null
+        : fbBuilder.writeList(_vectorOfStrongReferrables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
+    final int? vectorOfCoOwningReferencesOffset = _vectorOfCoOwningReferences == null ? null
+        : fbBuilder.writeListUint64(_vectorOfCoOwningReferences!);
+    final int? vectorOfNonOwningReferencesOffset = _vectorOfNonOwningReferences == null ? null
+        : fbBuilder.writeListUint64(_vectorOfNonOwningReferences!);
+    final int? anyUniqueOffset = _anyUnique?.getOrCreateOffset(fbBuilder);
+    final int? anyAmbiguousOffset = _anyAmbiguous?.getOrCreateOffset(fbBuilder);
+    final int? vectorOfEnumsOffset = _vectorOfEnums == null ? null
+        : fbBuilder.writeListUint8(_vectorOfEnums!.map((f) => f.value).toList());
+    final int? testrequirednestedflatbufferOffset = _testrequirednestedflatbuffer == null ? null
+        : fbBuilder.writeListUint8(_testrequirednestedflatbuffer!);
+    final int? scalarKeySortedTablesOffset = _scalarKeySortedTables == null ? null
+        : fbBuilder.writeList(_scalarKeySortedTables!.map((b) => b.getOrCreateOffset(fbBuilder)).toList());
+    fbBuilder.startTable(54);
     if (_pos != null) {
-      fbBuilder.addStruct(0, _pos.finish(fbBuilder));
+      fbBuilder.addStruct(0, _pos!.finish(fbBuilder));
     }
     fbBuilder.addInt16(1, _mana);
     fbBuilder.addInt16(2, _hp);
-    if (nameOffset != null) {
-      fbBuilder.addOffset(3, nameOffset);
-    }
-    if (inventoryOffset != null) {
-      fbBuilder.addOffset(5, inventoryOffset);
-    }
+    fbBuilder.addOffset(3, nameOffset);
+    fbBuilder.addOffset(5, inventoryOffset);
     fbBuilder.addUint8(6, _color?.value);
     fbBuilder.addUint8(7, _testType?.value);
-    if (testOffset != null) {
-      fbBuilder.addOffset(8, testOffset);
-    }
-    if (test4Offset != null) {
-      fbBuilder.addOffset(9, test4Offset);
-    }
-    if (testarrayofstringOffset != null) {
-      fbBuilder.addOffset(10, testarrayofstringOffset);
-    }
-    if (testarrayoftablesOffset != null) {
-      fbBuilder.addOffset(11, testarrayoftablesOffset);
-    }
-    if (enemyOffset != null) {
-      fbBuilder.addOffset(12, enemyOffset);
-    }
-    if (testnestedflatbufferOffset != null) {
-      fbBuilder.addOffset(13, testnestedflatbufferOffset);
-    }
-    if (testemptyOffset != null) {
-      fbBuilder.addOffset(14, testemptyOffset);
-    }
+    fbBuilder.addOffset(8, testOffset);
+    fbBuilder.addOffset(9, test4Offset);
+    fbBuilder.addOffset(10, testarrayofstringOffset);
+    fbBuilder.addOffset(11, testarrayoftablesOffset);
+    fbBuilder.addOffset(12, enemyOffset);
+    fbBuilder.addOffset(13, testnestedflatbufferOffset);
+    fbBuilder.addOffset(14, testemptyOffset);
     fbBuilder.addBool(15, _testbool);
     fbBuilder.addInt32(16, _testhashs32Fnv1);
     fbBuilder.addUint32(17, _testhashu32Fnv1);
@@ -1296,85 +1952,57 @@
     fbBuilder.addUint32(21, _testhashu32Fnv1a);
     fbBuilder.addInt64(22, _testhashs64Fnv1a);
     fbBuilder.addUint64(23, _testhashu64Fnv1a);
-    if (testarrayofboolsOffset != null) {
-      fbBuilder.addOffset(24, testarrayofboolsOffset);
-    }
+    fbBuilder.addOffset(24, testarrayofboolsOffset);
     fbBuilder.addFloat32(25, _testf);
     fbBuilder.addFloat32(26, _testf2);
     fbBuilder.addFloat32(27, _testf3);
-    if (testarrayofstring2Offset != null) {
-      fbBuilder.addOffset(28, testarrayofstring2Offset);
-    }
-    if (testarrayofsortedstructOffset != null) {
-      fbBuilder.addOffset(29, testarrayofsortedstructOffset);
-    }
-    if (flexOffset != null) {
-      fbBuilder.addOffset(30, flexOffset);
-    }
-    if (test5Offset != null) {
-      fbBuilder.addOffset(31, test5Offset);
-    }
-    if (vectorOfLongsOffset != null) {
-      fbBuilder.addOffset(32, vectorOfLongsOffset);
-    }
-    if (vectorOfDoublesOffset != null) {
-      fbBuilder.addOffset(33, vectorOfDoublesOffset);
-    }
-    if (parentNamespaceTestOffset != null) {
-      fbBuilder.addOffset(34, parentNamespaceTestOffset);
-    }
-    if (vectorOfReferrablesOffset != null) {
-      fbBuilder.addOffset(35, vectorOfReferrablesOffset);
-    }
+    fbBuilder.addOffset(28, testarrayofstring2Offset);
+    fbBuilder.addOffset(29, testarrayofsortedstructOffset);
+    fbBuilder.addOffset(30, flexOffset);
+    fbBuilder.addOffset(31, test5Offset);
+    fbBuilder.addOffset(32, vectorOfLongsOffset);
+    fbBuilder.addOffset(33, vectorOfDoublesOffset);
+    fbBuilder.addOffset(34, parentNamespaceTestOffset);
+    fbBuilder.addOffset(35, vectorOfReferrablesOffset);
     fbBuilder.addUint64(36, _singleWeakReference);
-    if (vectorOfWeakReferencesOffset != null) {
-      fbBuilder.addOffset(37, vectorOfWeakReferencesOffset);
-    }
-    if (vectorOfStrongReferrablesOffset != null) {
-      fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset);
-    }
+    fbBuilder.addOffset(37, vectorOfWeakReferencesOffset);
+    fbBuilder.addOffset(38, vectorOfStrongReferrablesOffset);
     fbBuilder.addUint64(39, _coOwningReference);
-    if (vectorOfCoOwningReferencesOffset != null) {
-      fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset);
-    }
+    fbBuilder.addOffset(40, vectorOfCoOwningReferencesOffset);
     fbBuilder.addUint64(41, _nonOwningReference);
-    if (vectorOfNonOwningReferencesOffset != null) {
-      fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset);
-    }
+    fbBuilder.addOffset(42, vectorOfNonOwningReferencesOffset);
     fbBuilder.addUint8(43, _anyUniqueType?.value);
-    if (anyUniqueOffset != null) {
-      fbBuilder.addOffset(44, anyUniqueOffset);
-    }
+    fbBuilder.addOffset(44, anyUniqueOffset);
     fbBuilder.addUint8(45, _anyAmbiguousType?.value);
-    if (anyAmbiguousOffset != null) {
-      fbBuilder.addOffset(46, anyAmbiguousOffset);
-    }
-    if (vectorOfEnumsOffset != null) {
-      fbBuilder.addOffset(47, vectorOfEnumsOffset);
-    }
+    fbBuilder.addOffset(46, anyAmbiguousOffset);
+    fbBuilder.addOffset(47, vectorOfEnumsOffset);
     fbBuilder.addInt8(48, _signedEnum?.value);
-    if (testrequirednestedflatbufferOffset != null) {
-      fbBuilder.addOffset(49, testrequirednestedflatbufferOffset);
+    fbBuilder.addOffset(49, testrequirednestedflatbufferOffset);
+    fbBuilder.addOffset(50, scalarKeySortedTablesOffset);
+    if (_nativeInline != null) {
+      fbBuilder.addStruct(51, _nativeInline!.finish(fbBuilder));
     }
+    fbBuilder.addUint64(52, _longEnumNonEnumDefault?.value);
+    fbBuilder.addUint64(53, _longEnumNormalDefault?.value);
     return fbBuilder.endTable();
   }
 
   /// Convenience method to serialize to byte list.
   @override
-  Uint8List toBytes([String fileIdentifier]) {
-    fb.Builder fbBuilder = new fb.Builder();
-    int offset = finish(fbBuilder);
-    return fbBuilder.finish(offset, fileIdentifier);
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
   }
 }
 class TypeAliases {
   TypeAliases._(this._bc, this._bcOffset);
   factory TypeAliases(List<int> bytes) {
-    fb.BufferContext rootRef = new fb.BufferContext.fromBytes(bytes);
+    final rootRef = fb.BufferContext.fromBytes(bytes);
     return reader.read(rootRef, 0);
   }
 
-  static const fb.Reader<TypeAliases> reader = const _TypeAliasesReader();
+  static const fb.Reader<TypeAliases> reader = _TypeAliasesReader();
 
   final fb.BufferContext _bc;
   final int _bcOffset;
@@ -1389,13 +2017,88 @@
   int get u64 => const fb.Uint64Reader().vTableGet(_bc, _bcOffset, 18, 0);
   double get f32 => const fb.Float32Reader().vTableGet(_bc, _bcOffset, 20, 0.0);
   double get f64 => const fb.Float64Reader().vTableGet(_bc, _bcOffset, 22, 0.0);
-  List<int> get v8 => const fb.ListReader<int>(const fb.Int8Reader()).vTableGet(_bc, _bcOffset, 24, null);
-  List<double> get vf64 => const fb.ListReader<double>(const fb.Float64Reader()).vTableGet(_bc, _bcOffset, 26, null);
+  List<int>? get v8 => const fb.Int8ListReader().vTableGetNullable(_bc, _bcOffset, 24);
+  List<double>? get vf64 => const fb.ListReader<double>(fb.Float64Reader()).vTableGetNullable(_bc, _bcOffset, 26);
 
   @override
   String toString() {
     return 'TypeAliases{i8: $i8, u8: $u8, i16: $i16, u16: $u16, i32: $i32, u32: $u32, i64: $i64, u64: $u64, f32: $f32, f64: $f64, v8: $v8, vf64: $vf64}';
   }
+
+  TypeAliasesT unpack() => TypeAliasesT(
+      i8: i8,
+      u8: u8,
+      i16: i16,
+      u16: u16,
+      i32: i32,
+      u32: u32,
+      i64: i64,
+      u64: u64,
+      f32: f32,
+      f64: f64,
+      v8: const fb.Int8ListReader(lazy: false).vTableGetNullable(_bc, _bcOffset, 24),
+      vf64: const fb.ListReader<double>(fb.Float64Reader(), lazy: false).vTableGetNullable(_bc, _bcOffset, 26));
+
+  static int pack(fb.Builder fbBuilder, TypeAliasesT? object) {
+    if (object == null) return 0;
+    return object.pack(fbBuilder);
+  }
+}
+
+class TypeAliasesT implements fb.Packable {
+  int i8;
+  int u8;
+  int i16;
+  int u16;
+  int i32;
+  int u32;
+  int i64;
+  int u64;
+  double f32;
+  double f64;
+  List<int>? v8;
+  List<double>? vf64;
+
+  TypeAliasesT({
+      this.i8 = 0,
+      this.u8 = 0,
+      this.i16 = 0,
+      this.u16 = 0,
+      this.i32 = 0,
+      this.u32 = 0,
+      this.i64 = 0,
+      this.u64 = 0,
+      this.f32 = 0.0,
+      this.f64 = 0.0,
+      this.v8,
+      this.vf64});
+
+  @override
+  int pack(fb.Builder fbBuilder) {
+    final int? v8Offset = v8 == null ? null
+        : fbBuilder.writeListInt8(v8!);
+    final int? vf64Offset = vf64 == null ? null
+        : fbBuilder.writeListFloat64(vf64!);
+    fbBuilder.startTable(12);
+    fbBuilder.addInt8(0, i8);
+    fbBuilder.addUint8(1, u8);
+    fbBuilder.addInt16(2, i16);
+    fbBuilder.addUint16(3, u16);
+    fbBuilder.addInt32(4, i32);
+    fbBuilder.addUint32(5, u32);
+    fbBuilder.addInt64(6, i64);
+    fbBuilder.addUint64(7, u64);
+    fbBuilder.addFloat32(8, f32);
+    fbBuilder.addFloat64(9, f64);
+    fbBuilder.addOffset(10, v8Offset);
+    fbBuilder.addOffset(11, vf64Offset);
+    return fbBuilder.endTable();
+  }
+
+  @override
+  String toString() {
+    return 'TypeAliasesT{i8: $i8, u8: $u8, i16: $i16, u16: $u16, i32: $i32, u32: $u32, i64: $i64, u64: $u64, f32: $f32, f64: $f64, v8: $v8, vf64: $vf64}';
+  }
 }
 
 class _TypeAliasesReader extends fb.TableReader<TypeAliases> {
@@ -1403,65 +2106,63 @@
 
   @override
   TypeAliases createObject(fb.BufferContext bc, int offset) => 
-    new TypeAliases._(bc, offset);
+    TypeAliases._(bc, offset);
 }
 
 class TypeAliasesBuilder {
-  TypeAliasesBuilder(this.fbBuilder) {
-    assert(fbBuilder != null);
-  }
+  TypeAliasesBuilder(this.fbBuilder);
 
   final fb.Builder fbBuilder;
 
   void begin() {
-    fbBuilder.startTable();
+    fbBuilder.startTable(12);
   }
 
-  int addI8(int i8) {
+  int addI8(int? i8) {
     fbBuilder.addInt8(0, i8);
     return fbBuilder.offset;
   }
-  int addU8(int u8) {
+  int addU8(int? u8) {
     fbBuilder.addUint8(1, u8);
     return fbBuilder.offset;
   }
-  int addI16(int i16) {
+  int addI16(int? i16) {
     fbBuilder.addInt16(2, i16);
     return fbBuilder.offset;
   }
-  int addU16(int u16) {
+  int addU16(int? u16) {
     fbBuilder.addUint16(3, u16);
     return fbBuilder.offset;
   }
-  int addI32(int i32) {
+  int addI32(int? i32) {
     fbBuilder.addInt32(4, i32);
     return fbBuilder.offset;
   }
-  int addU32(int u32) {
+  int addU32(int? u32) {
     fbBuilder.addUint32(5, u32);
     return fbBuilder.offset;
   }
-  int addI64(int i64) {
+  int addI64(int? i64) {
     fbBuilder.addInt64(6, i64);
     return fbBuilder.offset;
   }
-  int addU64(int u64) {
+  int addU64(int? u64) {
     fbBuilder.addUint64(7, u64);
     return fbBuilder.offset;
   }
-  int addF32(double f32) {
+  int addF32(double? f32) {
     fbBuilder.addFloat32(8, f32);
     return fbBuilder.offset;
   }
-  int addF64(double f64) {
+  int addF64(double? f64) {
     fbBuilder.addFloat64(9, f64);
     return fbBuilder.offset;
   }
-  int addV8Offset(int offset) {
+  int addV8Offset(int? offset) {
     fbBuilder.addOffset(10, offset);
     return fbBuilder.offset;
   }
-  int addVf64Offset(int offset) {
+  int addVf64Offset(int? offset) {
     fbBuilder.addOffset(11, offset);
     return fbBuilder.offset;
   }
@@ -1472,32 +2173,32 @@
 }
 
 class TypeAliasesObjectBuilder extends fb.ObjectBuilder {
-  final int _i8;
-  final int _u8;
-  final int _i16;
-  final int _u16;
-  final int _i32;
-  final int _u32;
-  final int _i64;
-  final int _u64;
-  final double _f32;
-  final double _f64;
-  final List<int> _v8;
-  final List<double> _vf64;
+  final int? _i8;
+  final int? _u8;
+  final int? _i16;
+  final int? _u16;
+  final int? _i32;
+  final int? _u32;
+  final int? _i64;
+  final int? _u64;
+  final double? _f32;
+  final double? _f64;
+  final List<int>? _v8;
+  final List<double>? _vf64;
 
   TypeAliasesObjectBuilder({
-    int i8,
-    int u8,
-    int i16,
-    int u16,
-    int i32,
-    int u32,
-    int i64,
-    int u64,
-    double f32,
-    double f64,
-    List<int> v8,
-    List<double> vf64,
+    int? i8,
+    int? u8,
+    int? i16,
+    int? u16,
+    int? i32,
+    int? u32,
+    int? i64,
+    int? u64,
+    double? f32,
+    double? f64,
+    List<int>? v8,
+    List<double>? vf64,
   })
       : _i8 = i8,
         _u8 = u8,
@@ -1514,17 +2215,12 @@
 
   /// Finish building, and store into the [fbBuilder].
   @override
-  int finish(
-    fb.Builder fbBuilder) {
-    assert(fbBuilder != null);
-    final int v8Offset = _v8?.isNotEmpty == true
-        ? fbBuilder.writeListInt8(_v8)
-        : null;
-    final int vf64Offset = _vf64?.isNotEmpty == true
-        ? fbBuilder.writeListFloat64(_vf64)
-        : null;
-
-    fbBuilder.startTable();
+  int finish(fb.Builder fbBuilder) {
+    final int? v8Offset = _v8 == null ? null
+        : fbBuilder.writeListInt8(_v8!);
+    final int? vf64Offset = _vf64 == null ? null
+        : fbBuilder.writeListFloat64(_vf64!);
+    fbBuilder.startTable(12);
     fbBuilder.addInt8(0, _i8);
     fbBuilder.addUint8(1, _u8);
     fbBuilder.addInt16(2, _i16);
@@ -1535,20 +2231,16 @@
     fbBuilder.addUint64(7, _u64);
     fbBuilder.addFloat32(8, _f32);
     fbBuilder.addFloat64(9, _f64);
-    if (v8Offset != null) {
-      fbBuilder.addOffset(10, v8Offset);
-    }
-    if (vf64Offset != null) {
-      fbBuilder.addOffset(11, vf64Offset);
-    }
+    fbBuilder.addOffset(10, v8Offset);
+    fbBuilder.addOffset(11, vf64Offset);
     return fbBuilder.endTable();
   }
 
   /// Convenience method to serialize to byte list.
   @override
-  Uint8List toBytes([String fileIdentifier]) {
-    fb.Builder fbBuilder = new fb.Builder();
-    int offset = finish(fbBuilder);
-    return fbBuilder.finish(offset, fileIdentifier);
+  Uint8List toBytes([String? fileIdentifier]) {
+    final fbBuilder = fb.Builder(deduplicateTables: false);
+    fbBuilder.finish(finish(fbBuilder), fileIdentifier);
+    return fbBuilder.buffer;
   }
 }