dart:ffi
LogoDart

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
Abi An application binary interface (ABI).
AbiSpecificInteger The supertype of all Abi -specific integer types.
AbiSpecificIntegerMapping Mapping for a subtype of AbiSpecificInteger .
Allocator Manages memory on the native heap.
Array<T extends NativeType> A fixed-sized array of Ts.
Bool Represents a native bool in C.
Char The C char type.
Dart_CObject Opaque, not exposing it's members.
DartRepresentationOf
DefaultAsset Annotation specifying the default asset ID for the current library.
Double Represents a native 64 bit double in C.
DynamicLibrary A dynamically loaded native library.
Finalizable Marker interface for objects which should not be finalized too soon.
Float Represents a native 32 bit float in C.
Handle Represents Dart_Handle from dart_api.h in C.
Int The C int type.
Int16 Represents a native signed 16 bit integer in C.
Int32 Represents a native signed 32 bit integer in C.
Int64 Represents a native signed 64 bit integer in C.
Int8 Represents a native signed 8 bit integer in C.
IntPtr The C intptr_t type.
Long The C long int, aka. long, type.
LongLong The C long long type.
Native<T> Annotation binding an external declaration to its native implementation.
NativeApi Utilities 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.
NativeFinalizer A native finalizer which can be attached to Dart objects.
NativeFunction<T extends Function> Represents a function type in C.
NativeType NativeType 's subtypes represent a native type in C.
Opaque Opaque 's subtypes represent opaque types in C.
Packed Annotation 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.
Short The C short type.
SignedChar The C signed char type.
Size The C size_t type.
SizedNativeType A NativeType with a known size.
Struct The supertype of all FFI struct types.
Uint16 Represents a native unsigned 16 bit integer in C.
Uint32 Represents a native unsigned 32 bit integer in C.
Uint64 Represents a native unsigned 64 bit integer in C.
Uint8 Represents a native unsigned 8 bit integer in C.
UintPtr The C uintptr_t type.
Union The supertype of all FFI union types.
UnsignedChar The C unsigned char type.
UnsignedInt The C unsigned int type.
UnsignedLong The C unsigned long int, aka. unsigned long, type.
UnsignedLongLong The C unsigned long long type.
UnsignedShort The C unsigned short type.
VarArgs<T extends Record> The types of variadic arguments passed in C.
Void Represents a void type in C.
WChar The C wchar_t type.

Extensions#

ExtensiononDescription
AbiSpecificIntegerArray<T extends AbiSpecificInteger> Array<T> Bounds checking indexing methods on Array s of AbiSpecificInteger .
AbiSpecificIntegerPointer<T extends AbiSpecificInteger> Pointer<T> Extension on Pointer specialized for the type argument AbiSpecificInteger .
AllocatorAlloc Allocator Extension 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 Array s of Array .
BoolAddress bool
BoolArray Array<Bool> Bounds checking indexing methods on Array s of Bool .
BoolPointer Pointer<Bool> Extension on Pointer specialized for the type argument Bool .
DoubleAddress double
DoubleArray Array<Double> Bounds checking indexing methods on Array s of Double .
DoublePointer Pointer<Double> Extension on Pointer specialized for the type argument Double .
DynamicLibraryExtension DynamicLibrary Method which must not be invoked dynamically.
Float32ListAddress Float32List
Float64ListAddress Float64List
FloatArray Array<Float> Bounds checking indexing methods on Array s of Float .
FloatPointer Pointer<Float> Extension on Pointer specialized for the type argument Float .
Int16Array Array<Int16> Bounds checking indexing methods on Array s of Int16 .
Int16ListAddress Int16List
Int16Pointer Pointer<Int16> Extension on Pointer specialized for the type argument Int16 .
Int32Array Array<Int32> Bounds checking indexing methods on Array s of Int32 .
Int32ListAddress Int32List
Int32Pointer Pointer<Int32> Extension on Pointer specialized for the type argument Int32 .
Int64Array Array<Int64> Bounds checking indexing methods on Array s of Int64 .
Int64ListAddress Int64List
Int64Pointer Pointer<Int64> Extension on Pointer specialized for the type argument Int64 .
Int8Array Array<Int8> Bounds checking indexing methods on Array s of Int8 .
Int8ListAddress Int8List
Int8Pointer Pointer<Int8> Extension on Pointer specialized for the type argument Int8 .
IntAddress int
NativeFunctionPointer<NF extends Function> Pointer<NativeFunction<NF>> Extension on Pointer specialized for the type argument NativeFunction .
NativePort SendPort Extension to retrieve the native Dart_Port from a SendPort .
PointerArray<T extends NativeType> Array<Pointer<T>> Bounds checking indexing methods on Array s 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 Array s of Struct .
StructPointer<T extends Struct> Pointer<T> Extension on Pointer specialized for the type argument Struct .
Uint16Array Array<Uint16> Bounds checking indexing methods on Array s of Uint16 .
Uint16ListAddress Uint16List
Uint16Pointer Pointer<Uint16> Extension on Pointer specialized for the type argument Uint16 .
Uint32Array Array<Uint32> Bounds checking indexing methods on Array s of Uint32 .
Uint32ListAddress Uint32List
Uint32Pointer Pointer<Uint32> Extension on Pointer specialized for the type argument Uint32 .
Uint64Array Array<Uint64> Bounds checking indexing methods on Array s of Uint64 .
Uint64ListAddress Uint64List
Uint64Pointer Pointer<Uint64> Extension on Pointer specialized for the type argument Uint64 .
Uint8Array Array<Uint8> Bounds checking indexing methods on Array s of Uint8 .
Uint8ListAddress Uint8List
Uint8Pointer Pointer<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 Array s 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
nullptr Represents a pointer into the native C memory corresponding to 'NULL', e.g. a pointer with address 0.

Typedefs#

TypedefDescription
Dart_NativeMessageHandler
NativeFinalizerFunction The native function type for NativeFinalizer s.