diff --git a/dart/lib/flat_buffers.dart b/dart/lib/flat_buffers.dart index 6f307872e10..2395992ae28 100644 --- a/dart/lib/flat_buffers.dart +++ b/dart/lib/flat_buffers.dart @@ -386,7 +386,7 @@ class Builder { /// Updates the [offset] pointer. This method is intended for use when writing structs to the buffer. void putFloat64(double value) { _prepare(_sizeofFloat64, 1); - _setFloat32AtTail(_tail, value); + _setFloat64AtTail(_tail, value); } /// Writes a Float32 to the tail of the buffer after preparing space for it. diff --git a/dart/test/flat_buffers_test.dart b/dart/test/flat_buffers_test.dart index caf2fc79a9e..83a6e2b3f1e 100644 --- a/dart/test/flat_buffers_test.dart +++ b/dart/test/flat_buffers_test.dart @@ -215,6 +215,10 @@ class BuilderTest { ..addTestarrayofstringOffset(testArrayOfString); final mon = monBuilder.finish(); fbBuilder.finish(mon); + + final mon3 = example.Monster(fbBuilder.buffer); + expect(mon3.name, 'MyMonster'); + expect(mon3.pos!.test1, 3.0); } void test_error_addInt32_withoutStartTable([Builder? builder]) {