Builder class

The main builder class for creation of a FlexBuffer.

Constructors

Builder({int size = 2048})
Instantiate the builder if you intent to gradually build up the buffer by calling add... methods and calling finish to receive the resulting byte array.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBlob(ByteBuffer value) → void
Adds a byte array.
addBool(bool value) → void
Adds a bool value.
addDouble(double value) → void
Adds a double value.
addDoubleIndirectly(double value, {bool cache = false}) → void
Stores double value indirectly in the buffer.
addInt(int value) → void
Adds a string value.
addIntIndirectly(int value, {bool cache = false}) → void
Stores int value indirectly in the buffer.
addKey(String value) → void
This methods adds a key to a map and should be followed by an add... value call.
addNull() → void
Use this method if you want to store a null value.
addString(String value) → void
Adds a string value.
end() → void
Marks that the addition of values to the last vector, or map have ended.
finish() Uint8List
Finish building the FlatBuffer and return array of bytes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
snapshot() ByteBuffer
Builds a FlatBuffer with current state without finishing the builder.
startMap() → void
This method starts a map definition.
startVector() → void
This method starts a vector definition and needs to be followed by 0 to n add... value calls.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

buildFromObject(Object? value) ByteBuffer
Use this method in order to turn an object into a FlexBuffer directly.