Skip to content

Commit b5c3cd3

Browse files
vaindJochen Parmentier
authored andcommitted
chore: Dart 23.5.26 release (google#8160)
* chore: update generated test code * chore: update changelog * update sdk constraints * chore: update readme * minor linter issues
1 parent 2d24d3d commit b5c3cd3

File tree

5 files changed

+101
-101
lines changed

5 files changed

+101
-101
lines changed

dart/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Changelog
2+
3+
## 23.5.26
4+
5+
- omit type annotationes for local variables (#7067, #7069, #7070)
6+
- remove BSD 3-clause license (#7073)
7+
- correctly parse lists of enums (#7157)
8+
- align naming conventions for generated code (#7187)
9+
- add `putBool` to fix errors when serializing structs with booleans (#7359)
10+
- fix handling of +/-inf defaults in codegen (#7588)
11+
- fix import issues in generated code (#7621)
12+
- Fix incorrect storage of floats as ints in some cases (#7703)
13+
- add final modifiers to the library implementation (#7943)
14+
115
## 2.0.5
216

317
- switch to null safety (#6696)

dart/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This package is used to read and write [FlatBuffers](https://google.github.io/flatbuffers/).
44

55
Most consumers will want to use the [`flatc` - FlatBuffer compiler](https://github.com/google/flatbuffers) binary for your platform.
6-
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).
6+
You can download the flatc version matching your dart package version from [GitHub releases](https://github.com/google/flatbuffers/releases).
77

88
The FlatBuffer compiler `flatc` reads a FlatBuffers IDL schema and generates Dart code.
99
The generated classes can be used to read or write binary data/files that are interoperable with
@@ -13,11 +13,3 @@ examples folder.
1313
For more details and documentation, head over to the official site and read the
1414
[Tutorial](https://google.github.io/flatbuffers/flatbuffers_guide_tutorial.html) and how to
1515
[use FlatBuffers in Dart](https://google.github.io/flatbuffers/flatbuffers_guide_use_dart.html).
16-
17-
## Dart 2.0 notes
18-
Version 2.0.5 ships with it's own custom build of `flatc` because this is an extraordinary release to catch-up
19-
with FlatBuffers for other platforms. This generator can only generate dart code (to avoid generating code for other platforms which isn't released yet).
20-
On the other hand, the generated code still produces standard binary FlatBuffers compatible with other languages.
21-
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++, ...).
22-
23-
In the future a common `flatc` binary for all platforms would be shipped through GitHub release page instead.

dart/pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ homepage: https://github.com/google/flatbuffers
55
documentation: https://google.github.io/flatbuffers/index.html
66

77
environment:
8-
sdk: '>=2.12.0 <3.0.0'
8+
sdk: '>=2.12.0 <4.0.0'
99

1010
dev_dependencies:
1111
test: ^1.17.7
1212
test_reflective_loader: ^0.2.0
1313
path: ^1.8.0
1414
lints: ^1.0.1
15-

dart/test/flat_buffers_test.dart

Lines changed: 85 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import './monster_test_my_game.example_generated.dart' as example;
1111
import './monster_test_my_game.example2_generated.dart' as example2;
1212
import './list_of_enums_generated.dart' as example3;
1313
import './bool_structs_generated.dart' as example4;
14-
import './keyword_test_keyword_test_generated.dart' as keyword_test;
1514

1615
main() {
1716
defineReflectiveSuite(() {
@@ -62,92 +61,91 @@ class CheckOtherLangaugesData {
6261

6362
// this will fail if accessing any field fails.
6463
expect(
65-
mon.toString(),
66-
'Monster{'
67-
'pos: Vec3{x: 1.0, y: 2.0, z: 3.0, test1: 3.0, test2: Color{value: 2}, test3: Test{a: 5, b: 6}}, '
68-
'mana: 150, hp: 80, name: MyMonster, inventory: [0, 1, 2, 3, 4], '
69-
'color: Color{value: 8}, testType: AnyTypeId{value: 1}, '
70-
'test: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
71-
'inventory: null, color: Color{value: 8}, testType: null, '
72-
'test: null, test4: null, testarrayofstring: null, '
73-
'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
74-
'testempty: null, testbool: false, testhashs32Fnv1: 0, '
75-
'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
76-
'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
77-
'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
78-
'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
79-
'testarrayofsortedstruct: null, flex: null, test5: null, '
80-
'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
81-
'vectorOfReferrables: null, singleWeakReference: 0, '
82-
'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
83-
'coOwningReference: 0, vectorOfCoOwningReferences: null, '
84-
'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
85-
'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, '
86-
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
87-
'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, '
88-
'nativeInline: null, '
89-
'longEnumNonEnumDefault: LongEnum{value: 0}, '
90-
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
91-
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
92-
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
93-
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, '
94-
'test4: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], '
95-
'testarrayofstring: [test1, test2], testarrayoftables: null, '
96-
'enemy: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
97-
'inventory: null, color: Color{value: 8}, testType: null, '
98-
'test: null, test4: null, testarrayofstring: null, '
99-
'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
100-
'testempty: null, testbool: false, testhashs32Fnv1: 0, '
101-
'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
102-
'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
103-
'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
104-
'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
105-
'testarrayofsortedstruct: null, flex: null, test5: null, '
106-
'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
107-
'vectorOfReferrables: null, singleWeakReference: 0, '
108-
'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
109-
'coOwningReference: 0, vectorOfCoOwningReferences: null, '
110-
'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
111-
'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, '
112-
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
113-
'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, '
114-
'nativeInline: null, '
115-
'longEnumNonEnumDefault: LongEnum{value: 0}, '
116-
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
117-
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
118-
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
119-
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, '
120-
'testnestedflatbuffer: null, testempty: null, testbool: true, '
121-
'testhashs32Fnv1: -579221183, testhashu32Fnv1: 3715746113, '
122-
'testhashs64Fnv1: 7930699090847568257, '
123-
'testhashu64Fnv1: 7930699090847568257, '
124-
'testhashs32Fnv1a: -1904106383, testhashu32Fnv1a: 2390860913, '
125-
'testhashs64Fnv1a: 4898026182817603057, '
126-
'testhashu64Fnv1a: 4898026182817603057, '
127-
'testarrayofbools: [true, false, true], testf: 3.14159, testf2: 3.0, '
128-
'testf3: 0.0, testarrayofstring2: null, testarrayofsortedstruct: ['
129-
'Ability{id: 0, distance: 45}, Ability{id: 1, distance: 21}, '
130-
'Ability{id: 5, distance: 12}], '
131-
'flex: null, test5: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], '
132-
'vectorOfLongs: [1, 100, 10000, 1000000, 100000000], '
133-
'vectorOfDoubles: [-1.7976931348623157e+308, 0.0, 1.7976931348623157e+308], '
134-
'parentNamespaceTest: null, vectorOfReferrables: null, '
135-
'singleWeakReference: 0, vectorOfWeakReferences: null, '
136-
'vectorOfStrongReferrables: null, coOwningReference: 0, '
137-
'vectorOfCoOwningReferences: null, nonOwningReference: 0, '
138-
'vectorOfNonOwningReferences: null, '
139-
'anyUniqueType: null, anyUnique: null, '
140-
'anyAmbiguousType: null, '
141-
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
142-
'testrequirednestedflatbuffer: null, scalarKeySortedTables: [Stat{id: '
143-
'miss, val: 0, count: 0}, Stat{id: hit, val: 10, count: 1}], '
144-
'nativeInline: Test{a: 1, b: 2}, '
145-
'longEnumNonEnumDefault: LongEnum{value: 0}, '
146-
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
147-
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
148-
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
149-
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}'
150-
);
64+
mon.toString(),
65+
'Monster{'
66+
'pos: Vec3{x: 1.0, y: 2.0, z: 3.0, test1: 3.0, test2: Color{value: 2}, test3: Test{a: 5, b: 6}}, '
67+
'mana: 150, hp: 80, name: MyMonster, inventory: [0, 1, 2, 3, 4], '
68+
'color: Color{value: 8}, testType: AnyTypeId{value: 1}, '
69+
'test: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
70+
'inventory: null, color: Color{value: 8}, testType: null, '
71+
'test: null, test4: null, testarrayofstring: null, '
72+
'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
73+
'testempty: null, testbool: false, testhashs32Fnv1: 0, '
74+
'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
75+
'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
76+
'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
77+
'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
78+
'testarrayofsortedstruct: null, flex: null, test5: null, '
79+
'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
80+
'vectorOfReferrables: null, singleWeakReference: 0, '
81+
'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
82+
'coOwningReference: 0, vectorOfCoOwningReferences: null, '
83+
'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
84+
'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, '
85+
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
86+
'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, '
87+
'nativeInline: null, '
88+
'longEnumNonEnumDefault: LongEnum{value: 0}, '
89+
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
90+
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
91+
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
92+
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, '
93+
'test4: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], '
94+
'testarrayofstring: [test1, test2], testarrayoftables: null, '
95+
'enemy: Monster{pos: null, mana: 150, hp: 100, name: Fred, '
96+
'inventory: null, color: Color{value: 8}, testType: null, '
97+
'test: null, test4: null, testarrayofstring: null, '
98+
'testarrayoftables: null, enemy: null, testnestedflatbuffer: null, '
99+
'testempty: null, testbool: false, testhashs32Fnv1: 0, '
100+
'testhashu32Fnv1: 0, testhashs64Fnv1: 0, testhashu64Fnv1: 0, '
101+
'testhashs32Fnv1a: 0, testhashu32Fnv1a: 0, testhashs64Fnv1a: 0, '
102+
'testhashu64Fnv1a: 0, testarrayofbools: null, testf: 3.14159, '
103+
'testf2: 3.0, testf3: 0.0, testarrayofstring2: null, '
104+
'testarrayofsortedstruct: null, flex: null, test5: null, '
105+
'vectorOfLongs: null, vectorOfDoubles: null, parentNamespaceTest: null, '
106+
'vectorOfReferrables: null, singleWeakReference: 0, '
107+
'vectorOfWeakReferences: null, vectorOfStrongReferrables: null, '
108+
'coOwningReference: 0, vectorOfCoOwningReferences: null, '
109+
'nonOwningReference: 0, vectorOfNonOwningReferences: null, '
110+
'anyUniqueType: null, anyUnique: null, anyAmbiguousType: null, '
111+
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
112+
'testrequirednestedflatbuffer: null, scalarKeySortedTables: null, '
113+
'nativeInline: null, '
114+
'longEnumNonEnumDefault: LongEnum{value: 0}, '
115+
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
116+
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
117+
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
118+
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}, '
119+
'testnestedflatbuffer: null, testempty: null, testbool: true, '
120+
'testhashs32Fnv1: -579221183, testhashu32Fnv1: 3715746113, '
121+
'testhashs64Fnv1: 7930699090847568257, '
122+
'testhashu64Fnv1: 7930699090847568257, '
123+
'testhashs32Fnv1a: -1904106383, testhashu32Fnv1a: 2390860913, '
124+
'testhashs64Fnv1a: 4898026182817603057, '
125+
'testhashu64Fnv1a: 4898026182817603057, '
126+
'testarrayofbools: [true, false, true], testf: 3.14159, testf2: 3.0, '
127+
'testf3: 0.0, testarrayofstring2: null, testarrayofsortedstruct: ['
128+
'Ability{id: 0, distance: 45}, Ability{id: 1, distance: 21}, '
129+
'Ability{id: 5, distance: 12}], '
130+
'flex: null, test5: [Test{a: 10, b: 20}, Test{a: 30, b: 40}], '
131+
'vectorOfLongs: [1, 100, 10000, 1000000, 100000000], '
132+
'vectorOfDoubles: [-1.7976931348623157e+308, 0.0, 1.7976931348623157e+308], '
133+
'parentNamespaceTest: null, vectorOfReferrables: null, '
134+
'singleWeakReference: 0, vectorOfWeakReferences: null, '
135+
'vectorOfStrongReferrables: null, coOwningReference: 0, '
136+
'vectorOfCoOwningReferences: null, nonOwningReference: 0, '
137+
'vectorOfNonOwningReferences: null, '
138+
'anyUniqueType: null, anyUnique: null, '
139+
'anyAmbiguousType: null, '
140+
'anyAmbiguous: null, vectorOfEnums: null, signedEnum: Race{value: -1}, '
141+
'testrequirednestedflatbuffer: null, scalarKeySortedTables: [Stat{id: '
142+
'miss, val: 0, count: 0}, Stat{id: hit, val: 10, count: 1}], '
143+
'nativeInline: Test{a: 1, b: 2}, '
144+
'longEnumNonEnumDefault: LongEnum{value: 0}, '
145+
'longEnumNormalDefault: LongEnum{value: 2}, nanDefault: NaN, '
146+
'infDefault: Infinity, positiveInfDefault: Infinity, infinityDefault: '
147+
'Infinity, positiveInfinityDefault: Infinity, negativeInfDefault: '
148+
'-Infinity, negativeInfinityDefault: -Infinity, doubleInfDefault: Infinity}');
151149
}
152150
}
153151

@@ -769,7 +767,6 @@ class BuilderTest {
769767
class ObjectAPITest {
770768
void test_tableStat() {
771769
final object1 = example.StatT(count: 3, id: "foo", val: 4);
772-
expect(object1 is Packable, isTrue);
773770
final fbb = Builder();
774771
fbb.finish(object1.pack(fbb));
775772
final object2 = example.Stat(fbb.buffer).unpack();

dart/test/monster_test.fbs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ struct Vec3 (force_align: 8) {
5959
test3:Test;
6060
}
6161

62-
// Stats for monster
63-
6462
struct Ability {
6563
id:uint(key);
6664
distance:uint;

0 commit comments

Comments
 (0)