registerLibraryReExport method

void registerLibraryReExport(
  1. String sourceUri,
  2. String targetUri, {
  3. Set<String>? show,
  4. Set<String>? hide,
})

GEN-107: Registers a re-export from one library to another.

This mirrors Dart's export 'other/library.dart' [show/hide …] directive: when sourceUri is loaded, the module loader will also merge the symbols from targetUri into the source library's per-module environment, applying show and hide filters.

Generated bridge code calls this once per export directive in the underlying Dart library so re-exports of stdlib types (e.g. flutter/services.dart re-exports dart:typed_data) become reachable through the source library without leaking into the global environment.

sourceUri The library doing the re-exporting (e.g. package:flutter/services.dart). targetUri The library being re-exported (e.g. dart:typed_data). show Optional set of names to include from targetUri. hide Optional set of names to exclude from targetUri.

Implementation

void registerLibraryReExport(
  String sourceUri,
  String targetUri, {
  Set<String>? show,
  Set<String>? hide,
}) {
  _libraryReExports.putIfAbsent(sourceUri, () => []).add((
    uri: targetUri,
    show: show,
    hide: hide,
  ));
}