dart - add Packable interface (#6846)

This commit is contained in:
Ivan Dlugos
2021-09-28 22:23:30 +02:00
committed by GitHub
parent 2ece9e25b4
commit b9d43a557c
14 changed files with 66 additions and 30 deletions

View File

@@ -125,12 +125,13 @@ class TableInNestedNS {
}
}
class TableInNestedNST {
class TableInNestedNST implements fb.Packable {
int foo;
TableInNestedNST({
this.foo = 0});
@override
int pack(fb.Builder fbBuilder) {
fbBuilder.startTable(1);
fbBuilder.addInt32(0, foo);
@@ -220,7 +221,7 @@ class StructInNestedNS {
}
}
class StructInNestedNST {
class StructInNestedNST implements fb.Packable {
int a;
int b;
@@ -228,6 +229,7 @@ class StructInNestedNST {
required this.a,
required this.b});
@override
int pack(fb.Builder fbBuilder) {
fbBuilder.putInt32(b);
fbBuilder.putInt32(a);