readiness_check library

Classes

AlignmentInfo
AndroidBuildSettings
Android build settings a plugin declares for itself in its own android/build.gradle (or build.gradle.kts) (SPEC §3.1.2).
AndroidInfo
Deadline
DiscoveryInfo
How discovery built the candidate set for this snapshot (SPEC §3.1.1, 2026-09-27 owner-approved rework): pub.dev searches, sorted by downloads.
DiscoveryQuery
One pub.dev search this discovery runs, sorted by downloads.
ElfAlignmentResult
The 16 KB alignment result for a single .so file (SPEC §3.1.2).
IosResolution
Which package — and which platform key on it — carries a plugin's iOS implementation.
LiveGrade
The SwiftPM and 16 KB alignment grade for a plugin the Flutter Ready data doesn't cover (CLI live-check task, 2026-09-27), computed on the spot from its already-downloaded archive alone. Pub.dev's score tags can't be fetched for a historical version, so — unlike swiftPmStatus — this never returns Status.amber.
NativeIosResult
Whether a plugin has native iOS code that could be blocked by the CocoaPods deadline, and why not when it doesn't (SPEC e2-s1 rework 2).
PackageInfo
Version, publish date and per-platform plugin declarations for a package's latest version, from GET /api/packages/<name>.
PackageScore
Tags, like count and 30-day download count for a package's latest version, from GET /api/packages/<name>/score (SPEC §3.1.3).
PackageVersion
One package's pubspec-derived PackageInfo paired with the archive URL for that same version (CLI live-check task, 2026-09-27), from either PubDevClient.fetchPackageVersion (an exact locked version) or PubDevClient.fetchLatestPackageVersion (a fallback when that version isn't locked).
PluginCandidate
A pub.dev package kept after discovery (SPEC §3.1.1), carrying the score tags already fetched so downstream checks (SwiftPM, alignment, Gradle facts) don't need to re-fetch them.
PluginEntry
PluginPlatformInfo
A single platform's entry under a plugin's pubspec.flutter.plugin.platforms map.
PubDevClient
Thin wrapper around the two pub.dev endpoints the readiness checks need.
Snapshot
SoFile
SwiftPmInfo
Data model for the readiness snapshot contract (schemaVersion 1), shared between the board (site) and the CLI (flutter_ready), so the two can't disagree (SPEC §2). Kept as a plain, dependency-free parser of the JSON shape documented in 10xs/workflow/instructions/20260927_05_architect-notes-e2-e6.md.
SwiftPmReadiness
Whether a plugin is ready for Swift Package Manager, per two independent signals (SPEC §3.1.2): pub.dev's own score tag, and the package's own archive.

Enums

Status
Colour rules are an architect decision, recorded in 10xs/workflow/instructions/20260927_05_architect-notes-e2-e6.md (section "e3-s1: Board rendering"). Android has no colour rule (SPEC open decision 3): it is shown as facts only.

Constants

discoveryQueries → const List<DiscoveryQuery>
The two searches discovery merges (SPEC §3.1.1, 2026-09-27 owner-approved rework): the likely reds first — plugins with no is:swiftpm-plugin tag — then the most-downloaded plugins overall for context.
requiredLoadSegmentAlignment → const int
The 16 KB page-alignment threshold Play requires (SPEC §3.1.2, §1).

Functions

alignmentEvidence(PluginEntry plugin) → String
A one-line summary of the evidence behind alignmentStatus.
alignmentStatus(PluginEntry plugin) → Status
checkPackageAlignment(Map<String, List<int>> soFileContents) → List<ElfAlignmentResult>
Runs checkSoAlignment over every entry in soFileContents.
checkSoAlignment(String path, List<int> bytes) → ElfAlignmentResult
Reads path's ELF program headers (32-bit or 64-bit, either endianness) and checks every PT_LOAD segment's alignment against requiredLoadSegmentAlignment (SPEC §3.1.2).
checkSwiftPmReadiness(PluginCandidate candidate, List<String> archiveEntryPaths) → SwiftPmReadiness
Checks candidate for SwiftPM readiness, using its already-fetched score tags and the entry paths of its own package archive.
declaresNativeIos(IosResolution resolution, PackageInfo? resolvedInfo, List<String> archiveEntryPaths) → bool
Whether the resolved package (resolution) ships native iOS code at all (SPEC e2-s1 rework): true when it declares pluginClass or ffiPlugin: true for IosResolution.platform itself, or its archive has a .podspec under ios/, macos/ or darwin/. False when it's Dart-only (dartPluginClass) with no podspec — nothing to migrate off CocoaPods, so the CocoaPods deadline can't block it.
discoverFlutterPlugins(PubDevClient client, {int resultsPerQuery = 100, int concurrency = 4}) → Future<List<PluginCandidate>>
Discovers Flutter plugin candidates from pub.dev search, reds first (SPEC §3.1.1, 2026-09-27): discoveryQueries, sorted by downloads, resultsPerQuery results each (rounded up to pages of 10 — pub.dev caps a single query at 100 results). Merges and dedupes both queries, then folds federated platform packages into their app-facing plugin so a plugin's downloads/status aren't split across rows.
extractAndroidBuildSettings(Map<String, List<int>> androidGradleFileContents) → AndroidBuildSettings?
Reads the Android build settings from whichever of android/build.gradle / android/build.gradle.kts is present in androidGradleFileContents (as produced by extractArchiveEntries(bytes, isAndroidGradleFilePath)).
extractArchiveEntries(List<int> archiveBytes, bool predicate(String path)) → Map<String, List<int>>
The contents of every entry inside a pub.dev package archive whose path satisfies predicate, keyed by entry path.
gradeLivePlugin({required PackageInfo? appInfo, required IosResolution resolution, required PackageInfo? resolvedInfo, required List<int> archiveBytes}) → LiveGrade
Grades archiveBytes — the resolved iOS package's archive, at its exact locked (or, failing that, latest) version — for both checks the nightly snapshot runs: SwiftPM readiness (resolveNativeIos plus checkSwiftPmReadiness's archive signal) and .so alignment (checkSoAlignment).
isAndroidGradleFilePath(String path) → bool
Whether path is one of the two Gradle files a plugin's Android build settings can be declared in, at the archive root.
isBlocked(PluginEntry plugin) → bool
Whether plugin carries the HireFlutter call to action: any red status blocks a release, whether from SwiftPM or 16 KB alignment (SPEC §2, §3.2).
isSharedLibraryPath(String path) → bool
Whether an archive entry path is a native shared library.
listArchiveEntryPaths(List<int> archiveBytes) → List<String>
The entry paths inside a pub.dev package archive (a gzip-compressed tar), without extracting any file contents.
mapWithConcurrency<T, R>(List<T> items, int concurrency, Future<R> worker(T item)) → Future<List<R>>
Runs worker over items with at most concurrency in flight at once, preserving input order in the result regardless of completion order.
resolveIosPackage(String pluginName, PackageInfo? appInfo) → IosResolution
Resolves which package's archive should be checked for a plugin's iOS readiness (SPEC e2-s1 rework). Federated plugins declare their real per-platform implementation via default_package; some declare it inline via pluginClass/ffiPlugin. iOS is preferred over macOS/darwin, and falling back to macOS only happens when the app-facing pubspec has no ios entry at all.
resolveNativeIos(PackageInfo? appInfo, IosResolution resolution, PackageInfo? resolvedInfo, List<String> archiveEntryPaths) → NativeIosResult
Combines the "not an iOS plugin at all" and "declares iOS but it's Dart-only" cases (SPEC e2-s1 rework 2). When the app-facing pubspec (appInfo) declares neither an ios nor a macos platform, Flutter never registers pods for this plugin on an iOS app, so a leftover ios/<name>.podspec in its own archive (a flutter create --template=plugin artifact) doesn't apply — declaresNativeIos isn't even consulted in that case.
swiftPmEvidence(PluginEntry plugin) → String
A one-line summary of the evidence behind swiftPmStatus (SPEC §3.2: "shows the evidence behind its colour").
swiftPmGreenSharePercent(List<PluginEntry> plugins) → int?
Share of plugins with a known SwiftPM status (green/amber/red — excludes "not checked") that are fully SwiftPM-ready, as a whole percent. Used for the trend view (SPEC §3.2: "trend over time ... share of top plugins that ship SwiftPM"). Returns null when no plugin in plugins has a known status.
swiftPmStatus(PluginEntry plugin) → Status

Exceptions / Errors

NotElfException
Thrown by checkSoAlignment when the given bytes don't start with the ELF magic number.
PubDevApiException
Thrown when a pub.dev API call does not return HTTP 200.