Dart_DeferredLoadHandler typedef

Dart_DeferredLoadHandler = Pointer<NativeFunction<Handle Function(IntPtr loading_unit_id)>>

Handles deferred loading requests. When this handler is invoked, it should eventually load the deferred loading unit with the given id and call Dart_DeferredLoadComplete or Dart_DeferredLoadCompleteError. It is recommended that the loading occur asynchronously, but it is permitted to call Dart_DeferredLoadComplete or Dart_DeferredLoadCompleteError before the handler returns.

If an error is returned, it will be propagated through prefix.loadLibrary(). This is useful for synchronous implementations, which must propagate any unwind errors from Dart_DeferredLoadComplete or Dart_DeferredLoadComplete. Otherwise the handler should return a non-error such as Dart_Null().

Implementation

typedef Dart_DeferredLoadHandler = ffi.Pointer<ffi.NativeFunction<ffi.Handle Function(ffi.IntPtr loading_unit_id)>>;