attached top-level constant

Object const attached

Metadata to annotate the field of a ProxyApi as an Attached Field.

Attached fields provide a synchronous ProxyApi instance as a field for another ProxyApi.

Attached fields:

  • Must be nonnull.
  • Must be a ProxyApi (a class annotated with @ProxyApi()).
  • Must not contain any unattached fields.
  • Must not have a required callback Flutter method.

Example generated code:

class MyProxyApi {
  final MyOtherProxyApi myField = __pigeon_myField().
}

The field provides access to the value synchronously, but the native instance is stored in the native InstanceManager asynchronously. Similar to how constructors are implemented.

Implementation

const Object attached = _Attached();