dart:ffi library Null safety

Foreign Function Interface for interoperability with the C programming language.

NOTE: Dart:FFI is in beta, and breaking API changes might still happen.

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

Classes

Dart_CObject
Opaque, not exposing it's members.
DartRepresentationOf
Double
Represents a native 64 bit double in C. [...]
DynamicLibrary
Represents a dynamically loaded C library.
Float
Represents a native 32 bit float in C. [...]
Handle
Represents Dart_Handle in C. [...]
Int8
Represents a native signed 8 bit integer in C. [...]
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. [...]
IntPtr
Represents a native pointer-sized integer in C. [...]
NativeApi
Utilities for accessing the Dart VM API from Dart code or from C code via dart_api_dl.h.
NativeFunction<T extends Function>
Represents a function type in C. [...]
NativeType
NativeType's subtypes represent a native type in C. [...]
Pointer<T extends NativeType>
Represents a pointer into the native C memory. Cannot be extended.
Struct
This class is extended to define structs. [...]
Uint8
Represents a native unsigned 8 bit integer in C. [...]
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. [...]
Unsized
Void
Represents a void type in C. [...]

Extensions

DoublePointer
Extension on Pointer specialized for the type argument Double.
DynamicLibraryExtension
Methods which cannot be invoked dynamically.
FloatPointer
Extension on Pointer specialized for the type argument Float.
Int8Pointer
Extension on Pointer specialized for the type argument Int8.
Int16Pointer
Extension on Pointer specialized for the type argument Int16.
Int32Pointer
Extension on Pointer specialized for the type argument Int32.
Int64Pointer
Extension on Pointer specialized for the type argument Int64.
IntPtrPointer
Extension on Pointer specialized for the type argument IntPtr.
NativeFunctionPointer
Extension on Pointer specialized for the type argument NativeFunction.
NativePort
Extension to retrieve the native Dart_Port from a SendPort.
PointerPointer
Extension on Pointer specialized for the type argument Pointer.
StructAddressOf
Extension on Struct specialized for its subtypes.
StructPointer
Extension on Pointer specialized for the type argument Struct.
Uint8Pointer
Extension on Pointer specialized for the type argument Uint8.
Uint16Pointer
Extension on Pointer specialized for the type argument Uint16.
Uint32Pointer
Extension on Pointer specialized for the type argument Uint32.
Uint64Pointer
Extension on Pointer specialized for the type argument Uint64.

Constants

unsized → const Unsized
This NativeType does not have predefined size. [...]
const Unsized()

Properties

nullptr Pointer<Never>
Represents a pointer into the native C memory corresponding to "NULL", e.g. a pointer with address 0.
final

Functions

sizeOf<T extends NativeType>() int
Number of bytes used by native type T. [...]

Typedefs

Dart_NativeMessageHandler(Int64, Pointer<Dart_CObject>) Void