Skip to content

dart:ffi

Foreign Function Interface for interoperability with the C programming language.

For further details, please see: https://dart.dev/server/c-interop.

Classes

ClassDescription
AbiAn application binary interface (ABI).
AbiSpecificIntegerThe supertype of all Abi-specific integer types.
AbiSpecificIntegerMappingMapping for a subtype of AbiSpecificInteger.
AllocatorManages memory on the native heap.
Array<T extends NativeType>A fixed-sized array of Ts.
BoolRepresents a native bool in C.
CharThe C char type.
Dart_CObjectOpaque, not exposing it's members.
DartRepresentationOf
DefaultAssetAnnotation specifying the default asset ID for the current library.
DoubleRepresents a native 64 bit double in C.
DynamicLibraryA dynamically loaded native library.
FinalizableMarker interface for objects which should not be finalized too soon.
FloatRepresents a native 32 bit float in C.
HandleRepresents Dart_Handle from dart_api.h in C.
IntThe C int type.
Int16Represents a native signed 16 bit integer in C.
Int32Represents a native signed 32 bit integer in C.
Int64Represents a native signed 64 bit integer in C.
Int8Represents a native signed 8 bit integer in C.
IntPtrThe C intptr_t type.
LongThe C long int, aka. long, type.
LongLongThe C long long type.
Native<T>Annotation binding an external declaration to its native implementation.
NativeApiUtilities for accessing the Dart VM API from Dart code or from C code via dart_api_dl.h.
NativeCallable<T extends Function>A native callable which listens for calls to a native function.
NativeFinalizerA native finalizer which can be attached to Dart objects.
NativeFunction<T extends Function>Represents a function type in C.
NativeTypeNativeType's subtypes represent a native type in C.
OpaqueOpaque's subtypes represent opaque types in C.
PackedAnnotation to specify on Struct subtypes to indicate that its members need to be packed.
Pointer<T extends NativeType>Represents a pointer into the native C memory. Cannot be extended.
ShortThe C short type.
SignedCharThe C signed char type.
SizeThe C size_t type.
SizedNativeTypeA NativeType with a known size.
StructThe supertype of all FFI struct types.
Uint16Represents a native unsigned 16 bit integer in C.
Uint32Represents a native unsigned 32 bit integer in C.
Uint64Represents a native unsigned 64 bit integer in C.
Uint8Represents a native unsigned 8 bit integer in C.
UintPtrThe C uintptr_t type.
UnionThe supertype of all FFI union types.
UnsignedCharThe C unsigned char type.
UnsignedIntThe C unsigned int type.
UnsignedLongThe C unsigned long int, aka. unsigned long, type.
UnsignedLongLongThe C unsigned long long type.
UnsignedShortThe C unsigned short type.
VarArgs<T extends Record>The types of variadic arguments passed in C.
VoidRepresents a void type in C.
WCharThe C wchar_t type.

Extensions

ExtensiononDescription
AbiSpecificIntegerArray<T extends AbiSpecificInteger>Array<T>Bounds checking indexing methods on Arrays of AbiSpecificInteger.
AbiSpecificIntegerPointer<T extends AbiSpecificInteger>Pointer<T>Extension on Pointer specialized for the type argument AbiSpecificInteger.
AllocatorAllocAllocatorExtension on Allocator to provide allocation with NativeType.
ArrayAddress<T extends NativeType>Array<T>
ArrayArray<T extends NativeType>Array<Array<T>>Bounds checking indexing methods on Arrays of Array.
BoolAddressbool
BoolArrayArray<Bool>Bounds checking indexing methods on Arrays of Bool.
BoolPointerPointer<Bool>Extension on Pointer specialized for the type argument Bool.
DoubleAddressdouble
DoubleArrayArray<Double>Bounds checking indexing methods on Arrays of Double.
DoublePointerPointer<Double>Extension on Pointer specialized for the type argument Double.
DynamicLibraryExtensionDynamicLibraryMethod which must not be invoked dynamically.
Float32ListAddressFloat32List
Float64ListAddressFloat64List
FloatArrayArray<Float>Bounds checking indexing methods on Arrays of Float.
FloatPointerPointer<Float>Extension on Pointer specialized for the type argument Float.
Int16ArrayArray<Int16>Bounds checking indexing methods on Arrays of Int16.
Int16ListAddressInt16List
Int16PointerPointer<Int16>Extension on Pointer specialized for the type argument Int16.
Int32ArrayArray<Int32>Bounds checking indexing methods on Arrays of Int32.
Int32ListAddressInt32List
Int32PointerPointer<Int32>Extension on Pointer specialized for the type argument Int32.
Int64ArrayArray<Int64>Bounds checking indexing methods on Arrays of Int64.
Int64ListAddressInt64List
Int64PointerPointer<Int64>Extension on Pointer specialized for the type argument Int64.
Int8ArrayArray<Int8>Bounds checking indexing methods on Arrays of Int8.
Int8ListAddressInt8List
Int8PointerPointer<Int8>Extension on Pointer specialized for the type argument Int8.
IntAddressint
NativeFunctionPointer<NF extends Function>Pointer<NativeFunction<NF>>Extension on Pointer specialized for the type argument NativeFunction.
NativePortSendPortExtension to retrieve the native Dart_Port from a SendPort.
PointerArray<T extends NativeType>Array<Pointer<T>>Bounds checking indexing methods on Arrays of Pointer.
PointerPointer<T extends NativeType>Pointer<Pointer<T>>Extension on Pointer specialized for the type argument Pointer.
StructAddress<T extends Struct>T
StructArray<T extends Struct>Array<T>Bounds checking indexing methods on Arrays of Struct.
StructPointer<T extends Struct>Pointer<T>Extension on Pointer specialized for the type argument Struct.
Uint16ArrayArray<Uint16>Bounds checking indexing methods on Arrays of Uint16.
Uint16ListAddressUint16List
Uint16PointerPointer<Uint16>Extension on Pointer specialized for the type argument Uint16.
Uint32ArrayArray<Uint32>Bounds checking indexing methods on Arrays of Uint32.
Uint32ListAddressUint32List
Uint32PointerPointer<Uint32>Extension on Pointer specialized for the type argument Uint32.
Uint64ArrayArray<Uint64>Bounds checking indexing methods on Arrays of Uint64.
Uint64ListAddressUint64List
Uint64PointerPointer<Uint64>Extension on Pointer specialized for the type argument Uint64.
Uint8ArrayArray<Uint8>Bounds checking indexing methods on Arrays of Uint8.
Uint8ListAddressUint8List
Uint8PointerPointer<Uint8>Extension on Pointer specialized for the type argument Uint8.
UnionAddress<T extends Union>T
UnionArray<T extends Union>Array<T>Bounds checking indexing methods on Arrays of Union.
UnionPointer<T extends Union>Pointer<T>Extension on Pointer specialized for the type argument Union.

Functions

FunctionDescription
sizeOf<T extends SizedNativeType>Number of bytes used by native type T.

Properties

PropertyDescription
nullptrRepresents a pointer into the native C memory corresponding to 'NULL', e.g. a pointer with address 0.

Typedefs

TypedefDescription
Dart_NativeMessageHandler
NativeFinalizerFunctionThe native function type for NativeFinalizers.