LayoutConst class
Factory methods for every layout type: the primary entry point for building layouts without calling each type's constructor directly.
Constructors
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
array(
Layout elementLayout, int length, {String? property}) → CustomLayout -
Fixed-
lengtharray ofelementLayoutelements. -
bcsBytes(
{String? property}) → CustomLayout< Map< String, dynamic> , List<int> > - Serializes and deserializes raw bytes with a length prefix encoded as LEB128.
-
bcsLazyEnum(
List< LazyVariantModel> variants, {String? property}) → CustomLayout<Map< String, dynamic> , Map<String, dynamic> > - Handles lazy serialization and deserialization of enums (variant types).
-
bcsMap<
K, V> (Layout< K> keyLayout, Layout<V> valueLayout, {String? property}) → CustomLayout - BCS-encoded map.
-
bcsOffset(
{String? property}) → LEB128U32OffsetLayout - Creates an offset layout using LEB128 encoding (used for compact integer representation).
-
bcsString(
{String? property}) → Layout< String> - Serializes and deserializes UTF-8 encoded strings.
-
bcsVector<
T> (Layout< T> elementLayout, {String? property}) → CustomLayout<Map< String, dynamic> , List<T> > -
Serializes and deserializes a vector (list) of elements using the provided
elementLayout. -
bigintLayout(
int length, {String? property, bool sign = false}) → BigIntLayout -
BigIntLayout of an arbitrary
lengthin bytes. -
bitSequenceLayout(
{String? property}) → BitSequenceLayout - Compact-length-prefixed bit sequence.
-
blob(
dynamic length, {String? property}) → RawBytesLayout - RawBytesLayout values.
-
boolean(
{String? property, Layout< int> ? layout, int falseFlag = 0, int trueFlag = 1}) → CustomLayout<int, bool> - bool values
-
boolean32(
{String? property}) → CustomLayout - Boolean value backed by a 4-byte integer.
-
boolean32Be(
{String? property}) → CustomLayout - bool backed by a big-endian u32.
-
byteArray(
int length, {bool resultAsHex = false, String? property}) → CustomLayout -
Fixed-
lengthbyte array, optionally decoded as a hex string. -
bytes(
{String? property}) → CompactBytes - Compact-length-prefixed raw byte blob.
-
compactArray(
Layout elementLayout, {String? property}) → CustomLayout - Alias of compactVec.
-
compactBigint(
BigIntLayout layout, {String? property}) → CompactBigIntLayout -
Compact-length-prefixed BigInt, validated against
layout's width. -
compactBigintU128(
{String? property}) → CompactBigIntLayout - Compact-length-prefixed unsigned 128-bit BigInt.
-
compactBigintU64(
{String? property}) → CompactBigIntLayout - Compact-length-prefixed unsigned 64-bit BigInt.
-
compactBytes(
{bool resultAsHex = false, String? property}) → Layout - Compact-length-prefixed byte blob, optionally decoded as a hex string.
-
compactInt(
IntegerLayout layout, {String? property}) → CompactIntLayout -
Compact-length-prefixed integer, validated against
layout's width. -
compactIntU32(
{String? property}) → CompactIntLayout - Compact-length-prefixed unsigned 32-bit integer.
-
compactIntU48(
{String? property}) → CompactIntLayout - Compact-length-prefixed unsigned 48-bit integer.
-
compactMap<
K, V> (Layout keyLayout, Layout valueLayout, {String? property}) → CustomLayout - Compact-length-prefixed map.
-
compactOffset(
{String? property}) → CompactOffsetLayout - CompactOffsetLayout backed by a compact unsigned 32-bit length.
-
compactString(
{String? property}) → Layout< String> - Compact-length-prefixed UTF-8 string.
-
compactVec<
T> (Layout< T> elementLayout, {String? property}) → CustomLayout<Map< String, dynamic> , List<T> > -
Compact-length-prefixed vector of
elementLayoutelements. -
constant<
T extends Object> (T value, {String? property}) → ConstantLayout< T> -
ConstantLayout holding a fixed
value. -
cOptionalPublicKey(
Layout layout, {String? property}) → COptionLayout -
COptionLayout for a Rust
COption<PublicKey>-shaped value. -
dynamicVector<
T> (Layout< T> elementLayout, {String? property}) → CustomLayout<Map< String, dynamic> , List<T> > -
Vector of
elementLayoutelements with no length prefix, decoded until the buffer is exhausted. -
enum32Be(
List< Layout> variants, {String? property, bool useKeyAndValue = true}) → CustomLayout<Map< String, dynamic> , Map<String, dynamic> > - Rust enum with a big-endian u32 discriminant.
-
f32(
{String? property}) → DoubleLayout - DoubleLayout (little-endian 32-bit floating point) values.
-
f32be(
{String? property}) → DoubleLayout - DoubleLayout (big-endian 32-bit floating point) values.
-
f64(
{String? property}) → DoubleLayout - DoubleLayout (little-endian 64-bit floating point) values.
-
f64be(
{String? property}) → DoubleLayout - DoubleLayout (big-endian 64-bit floating point) values.
-
fixedBlob32(
{String? property}) → RawBytesLayout - RawBytesLayout spanning a fixed 32 bytes.
-
fixedBlobN(
int len, {String? property}) → RawBytesLayout -
RawBytesLayout spanning a fixed
lenbytes. -
greedy(
{int elementSpan = 1, String? property}) → GreedyCount - GreedyCount.
-
greedyArray(
Layout elementLayout, {String? property}) → CustomLayout -
Array of
elementLayoutelements that consumes the rest of the buffer. -
i128(
{String? property}) → BigIntLayout - BigIntLayout (little-endian signed int layouts) interpreted as Numbers.
-
i16(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning two bytes.
-
i16Be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian signed int layouts) spanning two bytes.
-
i24(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning three bytes.
-
i256(
{String? property}) → BigIntLayout - BigIntLayout (little-endian signed int layouts) spanning 32 bytes.
-
i32(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning four bytes.
-
i32Be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian signed int layouts) spanning four bytes.
-
i40(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning five bytes.
-
i48(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning six bytes.
-
i64(
{String? property}) → BigIntLayout - BigIntLayout (little-endian signed int layouts) interpreted as Numbers.
-
i64Be(
{String? property}) → BigIntLayout - BigIntLayout (big-endian signed int layouts) interpreted as Numbers.
-
i8(
{String? property}) → IntegerLayout - IntegerLayout (signed int layouts) spanning one byte.
-
intLayout(
int length, {String? property, bool sign = false}) → IntegerLayout -
IntegerLayout of an arbitrary
lengthin bytes. -
lazyEnum(
List< LazyVariantModel> variants, {IntegerLayout? discriminant, String? property, bool useKeyAndValue = true}) → CustomLayout<Map< String, dynamic> , Map<String, dynamic> > - Lazy enum (variant layouts resolved via LazyUnion).
-
lazyEnumS32Be(
List< LazyVariantModel> variants, {required String? property, bool useKeyAndValue = true}) → CustomLayout<Map< String, dynamic> , Map<String, dynamic> > - Lazy enum with a big-endian s32 discriminant.
-
lazyEnumU32Be(
List< LazyVariantModel> variants, {required String? property, bool useKeyAndValue = true}) → CustomLayout<Map< String, dynamic> , Map<String, dynamic> > - Lazy enum with a big-endian u32 discriminant.
-
lazyStruct<
R extends LayoutRepository> (List< LazyStructLayoutBuilder< fields, {String? property, R? repository, bool decodePrefixes = false}) → LazyStructLayout<Object?, R> >R> - LazyStructLayout values.
-
lebBigInteger(
BigIntLayout validator, {String? property}) → Layout< BigInt> -
LEB128-encoded BigInt, validated against
validator's width. -
lebI128(
{String? property}) → Layout< BigInt> - LEB128-encoded signed 128-bit BigInt.
-
lebI256(
{String? property}) → Layout< BigInt> - LEB128-encoded signed 256-bit BigInt.
-
lebInteger(
IntegerLayout validator, {String? property}) → Layout< int> -
LEB128-encoded integer, validated against
validator's width. -
lebU32(
{String? property}) → Layout< int> - LEB128-encoded unsigned 32-bit integer.
-
lebU48(
{String? property}) → Layout< int> - LEB128-encoded unsigned 48-bit integer.
-
lebU64(
{String? property}) → Layout< BigInt> - LEB128-encoded unsigned 64-bit BigInt.
-
map(
Layout keyLayout, Layout valueLayout, {String? property}) → CustomLayout - map values
-
nameWithProperty(
String name, Layout? lo) → String -
Formats a debug name for
lo, including its property if set. -
noArgs(
{String? property}) → StructLayout - Empty StructLayout (no fields).
-
none<
T> ({String? property}) → NoneLayout< T> - no data values
-
ns64(
{String? property}) → BigIntLayout - BigIntLayout (little-endian signed int layouts) interpreted as Numbers.
-
nu64(
{String? property}) → BigIntLayout - BigIntLayout (little-endian unsigned int layouts) interpreted as Numbers.
-
offset(
PaddingLayout< int> layout, int offset, {String? property}) → OffsetLayout - OffsetLayout.
-
optional<
T> (Layout< T> layout, {String? property, bool keepSize = false, BaseInteger? discriminator}) → OptionalLayout<T> - OptionalLayout
-
optionalU32Be(
Layout layout, {String? property, bool keepSize = false}) → OptionalLayout - OptionalLayout with a big-endian u32 discriminator.
-
optionalVarint<
T> (Layout< T> layout, {String? property, bool keepSize = false, BaseInteger? discriminator}) → OptionalLayout<T> - OptionalLayout variant used with varint-based discriminators.
-
optionU64(
{String? property}) → OptionalLayout - Optional BigIntLayout (little-endian unsigned int layouts) interpreted as Numbers.
-
padding<
T> (BaseInteger< T> layout, {String? property}) → PaddingLayout<T> -
PaddingLayout wrapping
layout. -
rustEnum(
List< Layout> variants, {Layout? discriminant, String? property, bool useKeyAndValue = true}) → CustomLayout<Map< String, dynamic> , Map<String, dynamic> > - enum values
-
rustString(
{String? property}) → CustomLayout - Rust String values.
-
rustVec(
Layout elementLayout, {String? property}) → CustomLayout - factory for Rust vectors
-
rustVecOffset(
{String? property}) → OffsetLayout - OffsetLayout pointing 8 bytes before a Rust vector's data.
-
rustVecU8(
{String? property}) → CustomLayout - Rust vector values
-
s16(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning two bytes.
-
s16be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian signed int layouts) spanning two bytes.
-
s24(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning three bytes.
-
s24be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian signed int layouts) spanning three bytes.
-
s32(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning four bytes.
-
s32be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian signed int layouts) spanning four bytes.
-
s40(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning five bytes.
-
s40be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian signed int layouts) spanning five bytes.
-
s48(
{String? property}) → IntegerLayout - IntegerLayout (little-endian signed int layouts) spanning six bytes.
-
s48be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian signed int layouts) spanning six bytes.
-
s64be(
{String? property}) → BigIntLayout - BigIntLayout (big-endian signed int layouts) interpreted as Numbers.
-
s8(
{String? property}) → IntegerLayout - IntegerLayout (signed int layouts) spanning one byte.
-
seq<
T> (Layout elementLayout, Layout< int> count, {String? property}) → SequenceLayout - SequenceLayout values.
-
string(
{String? property}) → CustomLayout - String values
-
struct(
List< Layout> fields, {String? property, bool decodePrefixes = false}) → StructLayout - StructLayout values.
-
tuple(
List< Layout> layouts, {String? property}) → TupleLayout - tuple values
-
u128(
{String? property}) → BigIntLayout - BigIntLayout (little-endian unsigned int layouts) interpreted as Numbers.
-
u16(
{String? property}) → IntegerLayout - IntegerLayout (little-endian unsigned int layouts) spanning two bytes.
-
u16be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian unsigned int layouts) spanning two bytes.
-
u24(
{String? property}) → IntegerLayout - IntegerLayout (little-endian unsigned int layouts) spanning three bytes.
-
u24be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian unsigned int layouts) spanning three bytes.
-
u256(
{String? property}) → BigIntLayout - BigIntLayout (little-endian unsigned int layouts) interpreted as Numbers.
-
u32(
{String? property}) → IntegerLayout - IntegerLayout (little-endian unsigned int layouts) spanning four bytes.
-
u32be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian unsigned int layouts) spanning four bytes.
-
u40(
{String? property}) → IntegerLayout - IntegerLayout (little-endian unsigned int layouts) spanning five bytes.
-
u40be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian unsigned int layouts) spanning five bytes.
-
u48(
{String? property}) → IntegerLayout - IntegerLayout (little-endian unsigned int layouts) spanning six bytes.
-
u48be(
{String? property}) → IntegerLayout - IntegerLayout (big-endian unsigned int layouts) spanning six bytes.
-
u64(
{String? property}) → BigIntLayout - BigIntLayout (little-endian unsigned int layouts) interpreted as Numbers.
-
u64be(
{String? property}) → BigIntLayout - BigIntLayout (big-endian unsigned int layouts) interpreted as Numbers.
-
u8(
{String? property}) → IntegerLayout - IntegerLayout (unsigned int layouts) spanning one byte.
-
union(
dynamic discr, {String? property}) → Union - Union values.
-
varintLazyEnum(
List< LazyVariantModel> variants, {VarintIntLayout? discr, String? property}) → CustomLayout<Map< String, dynamic> , Map<String, dynamic> > - Lazy enum keyed by a varint-encoded discriminator.
-
varintOffset(
VarintIntLayout layout, {String? property}) → VarintOffsetLayout -
VarintOffsetLayout wrapping a varint-encoded
layout. -
varintU32Be(
{String? property}) → VarintIntLayout - Varint-encoded unsigned 32-bit integer, big-endian.
-
varintU32Le(
{String? property}) → VarintIntLayout - Varint-encoded unsigned 32-bit integer, little-endian.
-
varintVector<
T> (Layout< T> elementLayout, {String? property}) → CustomLayout<Map< String, dynamic> , List<T> > -
Vector of
elementLayoutelements, length-prefixed by a varint. -
vec(
Layout elementLayout, {String? property, IntegerLayout? lengthSizeLayout}) → CustomLayout - vectors
-
vecU8(
{String? property, IntegerLayout? lengthSizeLayout}) → CustomLayout - vector bytes
-
wrap(
Layout layout, {String? property}) → Layout - wrap layouts for property handling
-
xdrString(
{String? property}) → Layout< String> - XDR-encoded UTF-8 string.
-
xdrVec(
Layout elementLayout, {String? property}) → CustomLayout -
XDR-encoded vector of
elementLayoutelements. -
xdrVecBytes(
{String? property}) → Layout< List< int> > - XDR-encoded byte blob (4-byte-padded).