FfiNative<T> class Null safety

Annotation to be used for marking an external function as FFI native.

Example:

@FfiNative<Int64 Function(Int64, Int64)>('FfiNative_Sum', isLeaf:true)
external int sum(int a, int b);

Calling such functions will throw an exception if no resolver was set on the library or the resolver failed to resolve the name.

See Dart_SetFfiNativeResolver in dart_api.h

NOTE: This is an experimental feature and may change in the future.

Annotations
  • @Since('2.14')

Constructors

FfiNative(String nativeName, {bool isLeaf = false})
const

Properties

hashCode int
The hash code for this object.
read-onlyinherited
isLeaf bool
Specifies whether the function is a leaf function.
final
nativeName String
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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