Dart - finish/lowFinish/buffer changes (#6712)

* Dart - change Builder "lowFinish()" to "buffer" and "finish()" to not void return

Aligning the API with other languages, e.g. c++ and allowing custom use-cases to avoid creating a Uint8List

* Dart - change builder.buffer to check that finish() was already called

* Dart - builder - move !finished assertion to _prepare() which is run from all other functions
This commit is contained in:
Ivan Dlugos
2021-07-09 20:45:45 +02:00
committed by GitHub
parent 7482b25f8b
commit 92ae532e43
13 changed files with 134 additions and 71 deletions

View File

@@ -955,7 +955,8 @@ class DartGenerator : public BaseGenerator {
code += " " + _kFb + ".Builder fbBuilder = new ";
code += _kFb + ".Builder();\n";
code += " int offset = finish(fbBuilder);\n";
code += " return fbBuilder.finish(offset, fileIdentifier);\n";
code += " fbBuilder.finish(offset, fileIdentifier);\n";
code += " return fbBuilder.buffer;\n";
code += " }\n";
code += "}\n";
}