utils library

Functions

cleanEphemeralSymlinkCycles(String projectRoot) List<String>
Removes ephemeral CocoaPods/Flutter symlink trees under example/ that can make build_runner build hang forever with no error output and no CPU-idle signal (it looks identical to a slow build, just one that never finishes).
dedupeSharedSwiftDecls(String content, Set<String> alreadyDefined) String
Removes top-level shared declarations already defined by an earlier bridge file compiled into the same Swift module, tracking what has been seen cumulatively in alreadyDefined (caller keeps one set per module).
generatedHeaderStaleness(String content, {required String specHash, String? generatorVersion}) String?
Why a generated file is stale given its header, or null when current. Headers carry nitro_generator: <version> and (since 0.7.4) spec-sha256: <hash>; a file without the hash line predates the stamp and must be regenerated once. generatorVersion null skips that check (path dep — nothing to compare).
getAllProjects({Directory? baseDir}) List<ProjectInfo>
getGitBranch([String? workingDirectory]) Future<String>
getProjectInfo() ProjectInfo?
killBuildRunner({String? workingDirectory}) Future<int>
Kills any existing build_runner processes before starting a new one.
launchUrl(String url) → void
parsePubspec(Directory dir) ProjectInfo?
selectProjectBuildRunnerPids(Map<String, String> pidToCwd, String projectDir) List<String>
Selects the build_runner PIDs that belong to projectDir.
stripSharedSwiftPreamble(String content) String
Strips the shared public-type preamble from a Swift bridge file.
syncBridgeFiles(String workingDirectory, {String platform = 'ios'}) → void
Synchronizes generated bridge files from lib/src/generated to native project roots. platform is the platform directory name ('ios' or 'macos'). Defaults to 'ios'. This is needed for Apple development as CocoaPods/SPM normally uses copies instead of symlinks.
toPascalCase(String s) String