AnyNativeObject class

An opaque reference to any registered native implementation.

Equivalent to RN Nitro's AnyHybridObject. Wire format: int64_t instance ID — the same integer the bridge uses internally for every native impl.

Obtain one from a generated _XxxImpl via the asAnyNativeObject getter that the code generator adds to every bridge implementation class:

// Plugin A exposes a Camera hybrid object.
final camera = CameraImpl();
final ref = camera.asAnyNativeObject;  // AnyNativeObject(instanceId: 3)

// Plugin B accepts an opaque ref — doesn't need to know about Camera.
await pluginB.processObject(ref);

On the native side (Kotlin/Swift/C++) the bridge passes the raw int64_t. The receiving plugin can look the instance up in its own registry to recover the concrete type — identical to how RN Nitro's AnyHybridObject works.

Constructors

AnyNativeObject(int instanceId)
const

Properties

hashCode → int
The hash code for this object.
no setteroverride
instanceId → int
final
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.
override

Operators

operator ==(Object other) → bool
The equality operator.
override