mirror of
https://github.com/google/flatbuffers.git
synced 2026-08-07 17:22:02 +00:00
chore: Dart 23.5.26 release (#8160)
* chore: update generated test code * chore: update changelog * update sdk constraints * chore: update readme * minor linter issues
This commit is contained in:
@@ -1,3 +1,17 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## 23.5.26
|
||||||
|
|
||||||
|
- omit type annotationes for local variables (#7067, #7069, #7070)
|
||||||
|
- remove BSD 3-clause license (#7073)
|
||||||
|
- correctly parse lists of enums (#7157)
|
||||||
|
- align naming conventions for generated code (#7187)
|
||||||
|
- add `putBool` to fix errors when serializing structs with booleans (#7359)
|
||||||
|
- fix handling of +/-inf defaults in codegen (#7588)
|
||||||
|
- fix import issues in generated code (#7621)
|
||||||
|
- Fix incorrect storage of floats as ints in some cases (#7703)
|
||||||
|
- add final modifiers to the library implementation (#7943)
|
||||||
|
|
||||||
## 2.0.5
|
## 2.0.5
|
||||||
|
|
||||||
- switch to null safety (#6696)
|
- switch to null safety (#6696)
|
||||||
|
|||||||
+1
-9
@@ -3,7 +3,7 @@
|
|||||||
This package is used to read and write [FlatBuffers](https://google.github.io/flatbuffers/).
|
This package is used to read and write [FlatBuffers](https://google.github.io/flatbuffers/).
|
||||||
|
|
||||||
Most consumers will want to use the [`flatc` - FlatBuffer compiler](https://github.com/google/flatbuffers) binary for your platform.
|
Most consumers will want to use the [`flatc` - FlatBuffer compiler](https://github.com/google/flatbuffers) binary for your platform.
|
||||||
You can find it in the `generator/{Platform}` directory of the [released package archive](https://pub.dev/packages/flat_buffers/versions/2.0.5.tar.gz).
|
You can download the flatc version matching your dart package version from [GitHub releases](https://github.com/google/flatbuffers/releases).
|
||||||
|
|
||||||
The FlatBuffer compiler `flatc` reads a FlatBuffers IDL schema and generates Dart code.
|
The FlatBuffer compiler `flatc` reads a FlatBuffers IDL schema and generates Dart code.
|
||||||
The generated classes can be used to read or write binary data/files that are interoperable with
|
The generated classes can be used to read or write binary data/files that are interoperable with
|
||||||
@@ -13,11 +13,3 @@ examples folder.
|
|||||||
For more details and documentation, head over to the official site and read the
|
For more details and documentation, head over to the official site and read the
|
||||||
[Tutorial](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) and how to
|
[Tutorial](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) and how to
|
||||||
[use FlatBuffers in Dart](https://google.github.io/flatbuffers/flatbuffers_guide_use_dart.html).
|
[use FlatBuffers in Dart](https://google.github.io/flatbuffers/flatbuffers_guide_use_dart.html).
|
||||||
|
|
||||||
## Dart 2.0 notes
|
|
||||||
Version 2.0.5 ships with it's own custom build of `flatc` because this is an extraordinary release to catch-up
|
|
||||||
with FlatBuffers for other platforms. This generator can only generate dart code (to avoid generating code for other platforms which isn't released yet).
|
|
||||||
On the other hand, the generated code still produces standard binary FlatBuffers compatible with other languages.
|
|
||||||
In other words: only `flatc --dart ...` works with this generator, but your app will be able to produce and read standard binary (`Uint8List`) FlatBuffers that are fully compotible with other languages supporting FlatBuffers (e.g. Java, C++, ...).
|
|
||||||
|
|
||||||
In the future a common `flatc` binary for all platforms would be shipped through GitHub release page instead.
|
|
||||||
|
|||||||
+1
-2
@@ -5,11 +5,10 @@ homepage: https://github.com/google/flatbuffers
|
|||||||
documentation: https://google.github.io/flatbuffers/index.html
|
documentation: https://google.github.io/flatbuffers/index.html
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: '>=2.12.0 <4.0.0'
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
test: ^1.17.7
|
test: ^1.17.7
|
||||||
test_reflective_loader: ^0.2.0
|
test_reflective_loader: ^0.2.0
|
||||||
path: ^1.8.0
|
path: ^1.8.0
|
||||||
lints: ^1.0.1
|
lints: ^1.0.1
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import './monster_test_my_game.example_generated.dart' as example;
|
|||||||
import './monster_test_my_game.example2_generated.dart' as example2;
|
import './monster_test_my_game.example2_generated.dart' as example2;
|
||||||
import './list_of_enums_generated.dart' as example3;
|
import './list_of_enums_generated.dart' as example3;
|
||||||
import './bool_structs_generated.dart' as example4;
|
import './bool_structs_generated.dart' as example4;
|
||||||
import './keyword_test_keyword_test_generated.dart' as keyword_test;
|
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
defineReflectiveSuite(() {
|
defineReflectiveSuite(() {
|
||||||
@@ -62,92 +61,91 @@ class CheckOtherLangaugesData {
|
|||||||
|
|
||||||
// this will fail if accessing any field fails.
|
// this will fail if accessing any field fails.
|
||||||
expect(
|
expect(
|
||||||
mon.toString(),
|
mon.toString(),
|
||||||
'Monster{'
|
'Monster{'
|
||||||
'pos: Vec3{x: 1.0, y: 2.0, z: 3.0, test1: 3.0, test2: Color{value: 2}, test3: Test{a: 5, b: 6}}, '
|
'pos: Vec3{x: 1.0, y: 2.0, z: 3.0, test1: 3.0, test2: Color{value: 2}, test3: Test{a: 5, b: 6}}, '
|
||||||
'mana: 150, hp: 80, name: MyMonster, inventory: [0, 1, 2, 3, 4], '
|
'mana: 150, hp: 80, name: MyMonster, inventory: [0, 1, 2, 3, 4], '
|
||||||
'color: Color{value: 8}, testType: AnyTypeId{value: 1}, '
|
'color: Color{value: 8}, testType: AnyTypeId{value: 1}, '
|
||||||
'test: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
|
'test: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
|
||||||
'inventory: null, color: Color{value: 8}, testType: null, '
|
'inventory: null, color: Color{value: 8}, testType: null, '
|
||||||
'test: null, test4: null, testarrayofstring: null, '
|
'test: null, test4: null, testarrayofstring: null, '
|
||||||
'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
|
'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
|
||||||
'testempty: null, testbool: false, testhashs32Fnv1: 0, '
|
'testempty: null, testbool: false, testhashs32Fnv1: 0, '
|
||||||
'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
|
'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
|
||||||
'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
|
'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
|
||||||
'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
|
'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
|
||||||
'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
|
'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
|
||||||
'testarrayofsortedstruct: null, flex: null, test5: null, '
|
'testarrayofsortedstruct: null, flex: null, test5: null, '
|
||||||
'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
|
'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
|
||||||
'vectorOfReferrables: null, singleWeakReference: 0, '
|
'vectorOfReferrables: null, singleWeakReference: 0, '
|
||||||
'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
|
'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
|
||||||
'coOwningReference: 0, vectorOfCoOwningReferences: null, '
|
'coOwningReference: 0, vectorOfCoOwningReferences: null, '
|
||||||
'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
|
'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
|
||||||
'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, '
|
'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, '
|
||||||
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
|
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
|
||||||
'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, '
|
'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, '
|
||||||
'nativeInline: null, '
|
'nativeInline: null, '
|
||||||
'longEnumNonEnumDefault: LongEnum{value: 0}, '
|
'longEnumNonEnumDefault: LongEnum{value: 0}, '
|
||||||
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
|
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
|
||||||
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
|
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
|
||||||
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
|
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
|
||||||
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, '
|
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, '
|
||||||
'test4: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], '
|
'test4: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], '
|
||||||
'testarrayofstring: [test1, test2], testarrayoftables: null, '
|
'testarrayofstring: [test1, test2], testarrayoftables: null, '
|
||||||
'enemy: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
|
'enemy: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
|
||||||
'inventory: null, color: Color{value: 8}, testType: null, '
|
'inventory: null, color: Color{value: 8}, testType: null, '
|
||||||
'test: null, test4: null, testarrayofstring: null, '
|
'test: null, test4: null, testarrayofstring: null, '
|
||||||
'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
|
'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
|
||||||
'testempty: null, testbool: false, testhashs32Fnv1: 0, '
|
'testempty: null, testbool: false, testhashs32Fnv1: 0, '
|
||||||
'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
|
'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
|
||||||
'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
|
'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
|
||||||
'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
|
'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
|
||||||
'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
|
'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
|
||||||
'testarrayofsortedstruct: null, flex: null, test5: null, '
|
'testarrayofsortedstruct: null, flex: null, test5: null, '
|
||||||
'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
|
'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
|
||||||
'vectorOfReferrables: null, singleWeakReference: 0, '
|
'vectorOfReferrables: null, singleWeakReference: 0, '
|
||||||
'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
|
'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
|
||||||
'coOwningReference: 0, vectorOfCoOwningReferences: null, '
|
'coOwningReference: 0, vectorOfCoOwningReferences: null, '
|
||||||
'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
|
'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
|
||||||
'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, '
|
'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, '
|
||||||
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
|
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
|
||||||
'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, '
|
'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, '
|
||||||
'nativeInline: null, '
|
'nativeInline: null, '
|
||||||
'longEnumNonEnumDefault: LongEnum{value: 0}, '
|
'longEnumNonEnumDefault: LongEnum{value: 0}, '
|
||||||
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
|
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
|
||||||
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
|
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
|
||||||
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
|
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
|
||||||
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, '
|
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, '
|
||||||
'testnestedflatbuffer: null, testempty: null, testbool: true, '
|
'testnestedflatbuffer: null, testempty: null, testbool: true, '
|
||||||
'testhashs32Fnv1: -579221183, testhashu32Fnv1: 3715746113, '
|
'testhashs32Fnv1: -579221183, testhashu32Fnv1: 3715746113, '
|
||||||
'testhashs64Fnv1: 7930699090847568257, '
|
'testhashs64Fnv1: 7930699090847568257, '
|
||||||
'testhashu64Fnv1: 7930699090847568257, '
|
'testhashu64Fnv1: 7930699090847568257, '
|
||||||
'testhashs32Fnv1a: -1904106383, testhashu32Fnv1a: 2390860913, '
|
'testhashs32Fnv1a: -1904106383, testhashu32Fnv1a: 2390860913, '
|
||||||
'testhashs64Fnv1a: 4898026182817603057, '
|
'testhashs64Fnv1a: 4898026182817603057, '
|
||||||
'testhashu64Fnv1a: 4898026182817603057, '
|
'testhashu64Fnv1a: 4898026182817603057, '
|
||||||
'testarrayofbools: [true, false, true], testf: 3.14159, testf2: 3.0, '
|
'testarrayofbools: [true, false, true], testf: 3.14159, testf2: 3.0, '
|
||||||
'testf3: 0.0, testarrayofstring2: null, testarrayofsortedstruct: ['
|
'testf3: 0.0, testarrayofstring2: null, testarrayofsortedstruct: ['
|
||||||
'Ability{id: 0, distance: 45}, Ability{id: 1, distance: 21}, '
|
'Ability{id: 0, distance: 45}, Ability{id: 1, distance: 21}, '
|
||||||
'Ability{id: 5, distance: 12}], '
|
'Ability{id: 5, distance: 12}], '
|
||||||
'flex: null, test5: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], '
|
'flex: null, test5: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], '
|
||||||
'vectorOfLongs: [1, 100, 10000, 1000000, 100000000], '
|
'vectorOfLongs: [1, 100, 10000, 1000000, 100000000], '
|
||||||
'vectorOfDoubles: [-1.7976931348623157e+308, 0.0, 1.7976931348623157e+308], '
|
'vectorOfDoubles: [-1.7976931348623157e+308, 0.0, 1.7976931348623157e+308], '
|
||||||
'parentNamespaceTest: null, vectorOfReferrables: null, '
|
'parentNamespaceTest: null, vectorOfReferrables: null, '
|
||||||
'singleWeakReference: 0, vectorOfWeakReferences: null, '
|
'singleWeakReference: 0, vectorOfWeakReferences: null, '
|
||||||
'vectorOfStrongReferrables: null, coOwningReference: 0, '
|
'vectorOfStrongReferrables: null, coOwningReference: 0, '
|
||||||
'vectorOfCoOwningReferences: null, nonOwningReference: 0, '
|
'vectorOfCoOwningReferences: null, nonOwningReference: 0, '
|
||||||
'vectorOfNonOwningReferences: null, '
|
'vectorOfNonOwningReferences: null, '
|
||||||
'anyUniqueType: null, anyUnique: null, '
|
'anyUniqueType: null, anyUnique: null, '
|
||||||
'anyAmbiguousType: null, '
|
'anyAmbiguousType: null, '
|
||||||
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
|
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
|
||||||
'testrequirednestedflatbuffer: null, scalarKeySortedTables: [Stat{id: '
|
'testrequirednestedflatbuffer: null, scalarKeySortedTables: [Stat{id: '
|
||||||
'miss, val: 0, count: 0}, Stat{id: hit, val: 10, count: 1}], '
|
'miss, val: 0, count: 0}, Stat{id: hit, val: 10, count: 1}], '
|
||||||
'nativeInline: Test{a: 1, b: 2}, '
|
'nativeInline: Test{a: 1, b: 2}, '
|
||||||
'longEnumNonEnumDefault: LongEnum{value: 0}, '
|
'longEnumNonEnumDefault: LongEnum{value: 0}, '
|
||||||
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
|
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
|
||||||
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
|
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
|
||||||
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
|
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
|
||||||
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}'
|
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}');
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -769,7 +767,6 @@ class BuilderTest {
|
|||||||
class ObjectAPITest {
|
class ObjectAPITest {
|
||||||
void test_tableStat() {
|
void test_tableStat() {
|
||||||
final object1 = example.StatT(count: 3, id: "foo", val: 4);
|
final object1 = example.StatT(count: 3, id: "foo", val: 4);
|
||||||
expect(object1 is Packable, isTrue);
|
|
||||||
final fbb = Builder();
|
final fbb = Builder();
|
||||||
fbb.finish(object1.pack(fbb));
|
fbb.finish(object1.pack(fbb));
|
||||||
final object2 = example.Stat(fbb.buffer).unpack();
|
final object2 = example.Stat(fbb.buffer).unpack();
|
||||||
|
|||||||
@@ -59,8 +59,6 @@ struct Vec3 (force_align: 8) {
|
|||||||
test3:Test;
|
test3:Test;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stats for monster
|
|
||||||
|
|
||||||
struct Ability {
|
struct Ability {
|
||||||
id:uint(key);
|
id:uint(key);
|
||||||
distance:uint;
|
distance:uint;
|
||||||
|
|||||||
Reference in New Issue
Block a user