RitoNativeBindings.fromDynamicLibrary constructor

RitoNativeBindings.fromDynamicLibrary(
  1. DynamicLibrary library, {
  2. RitoArtifactDecoder artifactDecoder = const RitoArtifactDecoder(),
  3. RitoResourceDecoder resourceDecoder = const RitoResourceDecoder(),
  4. RitoFootnoteDecoder footnoteDecoder = const RitoFootnoteDecoder(),
})

Opens symbols from an explicitly supplied library for tests and native embedding diagnostics. Product callers should use the default constructor so Flutter resolves the bundled Native Asset.

Implementation

RitoNativeBindings.fromDynamicLibrary(
  DynamicLibrary library, {
  this.artifactDecoder = const RitoArtifactDecoder(),
  this.resourceDecoder = const RitoResourceDecoder(),
  this.footnoteDecoder = const RitoFootnoteDecoder(),
}) : _open = library.lookupFunction<_OpenNative, _OpenDart>('rito_open'),
     _openWithPinnedFonts = library
         .lookupFunction<
           _OpenWithPinnedFontsNative,
           _OpenWithPinnedFontsDart
         >('rito_open_with_pinned_fonts'),
     _requestArtifact = library
         .lookupFunction<_RequestArtifactNative, _RequestArtifactDart>(
           'rito_request_artifact',
         ),
     _requestAdjacent = library
         .lookupFunction<_RequestAdjacentNative, _RequestAdjacentDart>(
           'rito_request_adjacent',
         ),
     _peekAdjacent = library
         .lookupFunction<_RequestAdjacentNative, _RequestAdjacentDart>(
           'rito_peek_adjacent',
         ),
     _commitPeeked = library
         .lookupFunction<_OwnedWireRequestNative, _OwnedWireRequestDart>(
           'rito_commit_peeked_artifact',
         ),
     _readPublication = library
         .lookupFunction<_ReadPublicationNative, _ReadPublicationDart>(
           'rito_read_publication',
         ),
     _adoptForeground = library
         .lookupFunction<_OwnedWireRequestNative, _OwnedWireRequestDart>(
           'rito_adopt_foreground_candidate',
         ),
     _advanceBackground = library
         .lookupFunction<_OwnedWireRequestNative, _OwnedWireRequestDart>(
           'rito_advance_background',
         ),
     _adoptBackground = library
         .lookupFunction<_OwnedWireRequestNative, _OwnedWireRequestDart>(
           'rito_adopt_background_candidate',
         ),
     _readResource = library
         .lookupFunction<_ReadResourceNative, _ReadResourceDart>(
           'rito_read_resource',
         ),
     _readFootnote = library
         .lookupFunction<_ReadFootnoteNative, _ReadFootnoteDart>(
           'rito_read_footnote',
         ),
     _textRangeGeometry = library
         .lookupFunction<_OwnedWireRequestNative, _OwnedWireRequestDart>(
           'rito_get_text_range_geometry',
         ),
     _search = library
         .lookupFunction<_OwnedWireRequestNative, _OwnedWireRequestDart>(
           'rito_search',
         ),
     _release = library.lookupFunction<_ReleaseNative, _ReleaseDart>(
       'rito_release_artifact',
     ),
     _dispose = library.lookupFunction<_DisposeNative, _DisposeDart>(
       'rito_dispose',
     ),
     _bufferFree = library.lookupFunction<_BufferFreeNative, _BufferFreeDart>(
       'rito_buffer_free',
     );