diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..a437ec4 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,64 @@ +name: Build & publish docs + +# Builds the Nextra site from website/ and publishes website/out/ to the root of +# the gh-pages branch. GitHub Pages must be pointed at that branch once +# (Settings > Pages > Source: "Deploy from a branch", branch: gh-pages, +# folder: / (root)). The branch is not protected, so the bot can push to it, +# which is not possible on the protected main branch. +# +# 从 website/ 构建 Nextra 站点,并把 website/out/ 发布到 gh-pages 分支根目录。 +# GitHub Pages 需在仓库设置里一次性指向该分支(Settings > Pages > Source: +# "Deploy from a branch",branch: gh-pages,folder: / (root))。 +# 该分支不受保护,bot 可以推送;受保护的 main 分支则不行。 + +on: + push: + branches: + - main + paths: + - 'website/**' + - 'pubspec.yaml' + workflow_dispatch: + +# Serialize runs so two concurrent builds cannot fight over the branch. +concurrency: + group: docs-publish + cancel-in-progress: false + +permissions: + contents: write + +jobs: + publish-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: website/package-lock.json + + - name: Install website dependencies + run: npm ci + working-directory: website + + # --ci forces the build: CI checks out a clean tree, so the script's + # change detection (staged / unstaged diff) would otherwise skip it. + # The result lands in website/out/, with .nojekyll added by the script. + - name: Build site + run: node website/scripts/sync-docs.mjs --ci + + # force_orphan keeps gh-pages at a single commit holding only the built + # site, so the branch does not accumulate build history. + - name: Publish to gh-pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: website/out + force_orphan: true + user_name: 'github-actions[bot]' + user_email: '41898282+github-actions[bot]@users.noreply.github.com' + commit_message: 'chore(docs): publish built site' diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 0b19517..11c49e4 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -15,7 +15,13 @@ on: - 'README.md' - 'README_zh.md' - 'CHANGELOG.md' - - 'docs/**' + # website/pages/ is intentionally NOT scanned: the Nextra source uses + # extensionless route links (for example /Custom-Database-Provider) that + # lychee resolves as local files and reports as missing, which are false + # positives. Those routes are validated by the site build itself. + # 刻意不扫描 website/pages/:Nextra 源码使用无扩展名的路由链接(例如 + # /Custom-Database-Provider),lychee 会按本地文件解析并误报缺失。 + # 这些站内路由由站点构建本身保证。 # Allow manual runs from the Actions tab. # 允许在 Actions 页手动触发。 workflow_dispatch: @@ -44,7 +50,7 @@ jobs: --retry-wait-time 2 --max-retries 2 --exclude "https://raw.githubusercontent.com/zero-labsco/zero_inspector_kit/main/image/mascot/.*" - README.md README_zh.md CHANGELOG.md "docs/**" + README.md README_zh.md CHANGELOG.md fail: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pubignore b/.pubignore index 1284206..feb90bd 100644 --- a/.pubignore +++ b/.pubignore @@ -1,8 +1,3 @@ -# Exclude the GitHub Pages documentation site from the published package. -# The docs/ folder is served via the docs/github-pages branch (GitHub Pages), -# not distributed through pub.dev. -docs/ - # Project-internal agent/IDE data — must not be published to pub.dev. .codebuddy/ diff --git a/AGENTS.md b/AGENTS.md index 1ff80c9..6420094 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,7 +85,7 @@ Notes / 说明: - `stale.yml`: `actions/stale@v11` marks stale issues/PRs. - `dependabot-pr-bilingual.yml`: `actions/github-script@v7` appends a bilingual (EN-primary, ZH-secondary) summary to the **body** of Dependabot PRs only (`github.actor == 'dependabot[bot]'`, idempotent via marker). It does NOT touch the PR title or commit subject — those stay English per the Conventional Commits rule. When reviewing Dependabot PRs, verify the build passes, check changelogs for breaking changes on major bumps, and confirm the caret (`^`) constraint is preserved. - `dart-format-fix.yml`: on PR `opened`/`synchronize`/`reopened` (and `workflow_dispatch` manual trigger), runs `dart format .` and, if it changed anything, auto-commits and pushes the fix back to the **same PR branch** as `github-actions[bot]`. Keeps style consistent without reviewer nudging. Note: uses `pull_request` (not `pull_request_target`) with `permissions: contents: write`; if branch protection blocks workflow pushes or requires signed commits, switch it to open a fix branch / post a comment instead. -- `link-check.yml`: on PR changes to `README.md`, `README_zh.md`, `CHANGELOG.md`, `docs/**` (and `workflow_dispatch` manual trigger), runs `lychee-action@v2` to scan those docs for dead/broken links and fails only on real broken links (mailto and common redirects/rate-limits are excluded). Use the Actions tab manual run to scan the default branch on demand. +- `link-check.yml`: on PR changes to `README.md`, `README_zh.md`, `CHANGELOG.md` (and `workflow_dispatch` manual trigger), runs `lychee-action@v2` to scan those docs for dead/broken links and fails only on real broken links (mailto and common redirects/rate-limits are excluded). `website/pages/` is deliberately **not** scanned: the Nextra source uses extensionless route links (for example `/Custom-Database-Provider`) that lychee resolves as local files and reports as missing, producing false positives — those routes are validated by the site build instead. Use the Actions tab manual run to scan the default branch on demand. - `pr-title-check.yml` details: allowed types are `feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert`; `requireScope` is `false`; PRs labeled `dependencies` or `github-actions` are ignored. The same type list applies to commit messages (Conventional Commits). - `paths-ignore` skips pure assets/non-package files (images `**.png`/`**.jpg`/`**gif`/`**webp`/`**svg`/`**ico`, `**.txt`, `**.gitignore`, `LICENSE`, example build artifacts, etc.) but it MUST NOT blanket-ignore all `**.md` or `docs/**`. `README*.md`, `CHANGELOG.md`, `CONTRIBUTING.md`, `TODO.md`, `docs/**` are intentionally **kept OUT of `paths-ignore`** so docs-only PRs still trigger the `ci.yml` workflow — otherwise the entire workflow would be skipped and the branch-protection required checks would never appear (yellow), blocking merge. - Whether a triggered run actually executes the heavy jobs is decided by the `path-filter` job's `code` output: @@ -117,7 +117,7 @@ Notes / 说明: / 每条变更必须英中双语(英文为主、中文为辅,EN-primary, ZH-secondary)。不要用 ` / ` 斜杠分隔中英文(太不显眼)。改用嵌套子条目:英文描述作为一级条目,中文翻译缩进为其下方子条目,且**不要**加"中文:" / "EN:" 这类显式标签。小节标题保持 `### Fixed / 修复`、`### Changed / 优化`、`### Added / 新增` 形式。 - **Changelog scope rule / 变更日志范围规则:** Only changes to `lib/` (i.e. published-package runtime behavior) earn a CHANGELOG entry. Pure documentation updates (`README*.md`, `website/`, `docs/`) and `example/` changes must NOT get a CHANGELOG entry — they do not change the released package's runtime behavior. The single exception is a **pure version-bump commit**: bumping the version legitimately updates the CHANGELOG (and the doc version strings) as part of cutting the release, which is allowed. / 只有 `lib/` 的改动(即已发布包的运行行为)才进 CHANGELOG;纯文档(`README*.md`、`website/`、`docs/`)与 `example/` 的改动不应写进 CHANGELOG——它们不改变发布包的运行行为。唯一的例外是「单纯 bump 版本」的提交:为发版而更新 CHANGELOG(及文档版本号)是允许的。 - Grep sanity check before committing: `grep -rn "old_version" README.md README_zh.md website/pages` must return NOTHING (only legitimate historical prose may remain; the `__ZIK_VERSION__` placeholder is expected and is not a real version). - **Website (Nextra docs site):** `website/` is built and synced to `docs/` automatically by the `pre-commit` hook (`website/scripts/sync-docs.mjs`). Version references in `website/pages/*.md` use the `__ZIK_VERSION__` placeholder, which is filled from `pubspec.yaml` at build time — bumping `pubspec.yaml` propagates to the site automatically. Never edit `docs/` by hand; it is regenerated on every commit that touches `website/`. + **Website (Nextra docs site):** `website/` is built by CI — `.github/workflows/docs.yml` runs `website/scripts/sync-docs.mjs --ci` whenever `website/**` or `pubspec.yaml` changes on `main`, and publishes `website/out/` to the root of the `gh-pages` branch. Version references in `website/pages/*.md` use the `__ZIK_VERSION__` placeholder, which is filled from `pubspec.yaml` at build time — bumping `pubspec.yaml` propagates to the site automatically. `main` no longer contains a generated `docs/` directory, so there is no build output to commit and nothing to conflict on. 2. Update `README.md` / `CHANGELOG.md` as needed. 3. Locally verify before pushing: - `dart format .` — must report no changes. The `dart-format-fix.yml` CI workflow auto-commits any formatting diff back to the PR branch, so keep the tree formatted locally to avoid surprise commits. @@ -136,16 +136,17 @@ Notes / 说明: - **Checked-in file ignored by `.gitignore`** — Pub flags any file that is BOTH in the git index AND matched by `.gitignore` (error message points at e.g. `.codebuddy/skills/zero-inspector-kit/SKILL.md`). Fix: do NOT try to solve this with `.pubignore` (pub's "checked-in but ignored" check ignores `.pubignore`); instead **untrack** the path so it is no longer "checked in": `git rm -r --cached .codebuddy` (file stays on disk, remains gitignored, no longer in the index). Keep `.codebuddy/` ignored in `.gitignore` — it is personal IDE data. -- **Top-level `docs/` directory (plural name)** — Pub warns that plural top-level dirs aren't recognized by its layout convention and suggests renaming to `doc/`. Do NOT rename: `docs/` is the GitHub Pages site (served from `docs/github-pages`), renaming breaks the Pages workflow. Fix: exclude it from the package via `.pubignore` (`docs/`). -- **`.pubignore` usage** — Add a `.pubignore` at repo root to keep repo-internal content out of the published tarball. Recommended entries: `docs/`, `.codebuddy/`, `AGENTS.md`, `CONTRIBUTING.md`, `TODO.md`. `.pubignore` is respected by `dart pub publish` but does NOT silence the "checked-in but gitignored" conflict above. +- **Top-level `docs/` directory (plural name)** — Pub used to warn that plural top-level dirs aren't recognized by its layout convention and suggested renaming to `doc/`. This no longer applies: the generated `docs/` directory has been removed from `main`, because the site is now published to the `gh-pages` branch instead. Do not reintroduce a checked-in `docs/`. +- **`.pubignore` usage** — Add a `.pubignore` at repo root to keep repo-internal content out of the published tarball. Recommended entries: `.codebuddy/`, `AGENTS.md`, `CONTRIBUTING.md`, `TODO.md` (the old `docs/` entry is obsolete — that directory no longer exists). `.pubignore` is respected by `dart pub publish` but does NOT silence the "checked-in but gitignored" conflict above. When re-tagging after a fix, force-update both the `vX.Y.Z` tag and the `release/vX.Y.Z` archive branch to the new commit so the publish job runs against the corrected tree. ### Documentation site (GitHub Pages) -- Source content lives in `docs/`. The legacy `wiki/` directory was removed; `docs/` is now the single source of truth. -- Publishing branch: `docs/github-pages`; GitHub Pages serves the `/docs` folder of that branch. +- Source content lives in `website/` (Nextra) and is the only hand-edited documentation source. +- GitHub Pages serves the **root** of the `gh-pages` branch (Source: "Deploy from a branch", branch `gh-pages`, folder `/ (root)`). This is a one-time repository setting. The branch is generated and force-pushed by CI, so never commit to it by hand. - Live site: https://zero-labsco.github.io/zero_inspector_kit/ -- To update docs: edit `docs/` on `docs/github-pages`, commit, push; Pages redeploys automatically. +- Builds run in CI, not locally: pushes to `main` touching `website/**` or `pubspec.yaml` trigger `docs.yml`, which builds `website/out/` and force-orphan-publishes it to `gh-pages` as `github-actions[bot]`. A separate Pages branch is required because `main` is branch-protected — the bot cannot push there. +- To preview locally: `cd website && npm ci && npm run build` (output in `website/out/`), or `node website/scripts/sync-docs.mjs --ci`. - `pubspec.yaml` has a `documentation:` field pointing to the site (rendered on pub.dev). Keep it in sync after the site URL is stable. ## New feature development checklist @@ -156,5 +157,5 @@ When re-tagging after a fix, force-update both the `vX.Y.Z` tag and the `release - [ ] Run `flutter analyze` and `flutter test` locally before pushing. - [ ] Use a typed branch (`feat/...`) and a Conventional Commits PR title. - [ ] Ensure the 3 required status checks pass before requesting review/merge. -- [ ] For user-facing changes, update `README.md` and the `website/` source (the `docs/` site is built and synced automatically by the pre-commit hook). +- [ ] For user-facing changes, update `README.md` and the `website/` source (the site is rebuilt and published by the `docs.yml` CI workflow once the change lands on `main`). - [ ] For releases, bump `version` AND follow the **Mandatory version-bump checklist** under "Release and publish" above (pubspec, iOS podspec, README.md, README_zh.md, `website/pages/*.md` via the `__ZIK_VERSION__` placeholder, CHANGELOG.md — grep for the old version string to confirm nothing is left). Tag `vX.Y.Z` (triggers publish), and optionally push a `release/vX.Y.Z` archive branch via explicit refspec. diff --git a/CHANGELOG.md b/CHANGELOG.md index e8f27e5..03c9e0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 1.15.0 + +### Added / 新增 +- Added Swift Package Manager (SPM) support for iOS. The iOS native code now ships as a Swift package (`ios/zero_inspector_kit/Package.swift`, library `zero-inspector-kit`, iOS 13.0 or later), so projects that have migrated off CocoaPods can consume the plugin. CocoaPods support is retained, as Flutter requires plugins to support both until further notice. + - 新增 iOS 端 Swift Package Manager(SPM)支持。iOS 原生代码现以 Swift 包形式提供(`ios/zero_inspector_kit/Package.swift`,库名 `zero-inspector-kit`,iOS 13.0 及以上),便于已从 CocoaPods 迁移的项目接入。仍保留 CocoaPods 支持,因为 Flutter 要求插件暂时同时支持两者。 + +### Changed / 优化 +- Moved the iOS native sources from `ios/Classes` and `ios/Resources` into the Swift package layout at `ios/zero_inspector_kit/Sources/zero_inspector_kit/`; the podspec now points at the new paths, and `PrivacyInfo.xcprivacy` (present but previously unused) is now bundled. + - 将 iOS 原生源码从 `ios/Classes` 与 `ios/Resources` 迁移到 Swift 包布局 `ios/zero_inspector_kit/Sources/zero_inspector_kit/`;podspec 同步指向新路径,并打包此前存在但未生效的 `PrivacyInfo.xcprivacy`。 + +### Fixed / 修复 +- Fixed iOS `availMem` reporting: it was estimated as "device total physical memory minus this process RSS", which ignored other processes and badly over-reported available memory (for example reporting roughly 5.8 GB when only about 800 MB was actually free). It now uses `os_proc_available_memory()` on iOS 13+, whose semantics are the memory available to the current process. The now-unused `getUsedMemory()` helper was removed. + - 修复 iOS `availMem` 上报错误:此前按「设备总物理内存减去本进程 RSS」估算,忽略其它进程占用,会严重高估可用内存(例如实际仅剩约 800MB 时上报约 5.8GB)。现改用 `os_proc_available_memory()`(iOS 13+),语义为当前进程可用内存。同时移除了不再使用的 `getUsedMemory()` 辅助方法。 + ## 1.14.1 ### Fixed / 修复 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ad6a83..914df24 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,7 @@ This project is licensed under MPL-2.0. By participating, you are expected to up - Flutter >= 3.3.0 (stable channel) - Dart >= 3.11.0 -- Node.js (required by the pre-commit `docs-sync` hook; without it `git commit` fails the hook) +- Node.js (only needed to preview the docs site locally: `cd website && npm ci && npm run build`. The site build runs in CI, so committing does not require Node) - Android Studio / Xcode (for platform-specific testing) - Git @@ -160,7 +160,7 @@ Name test files `_test.dart` and place them under `test/` mirroring ## Pull Request Process 1. **Update CHANGELOG.md** under an `## [Unreleased]` section (or create one if missing). Describe what changed and why. -2. **Update documentation** if your change affects public API or user-facing behavior (README.md, README_zh.md, docs/). +2. **Update documentation** if your change affects public API or user-facing behavior (README.md, README_zh.md, `website/pages/`). 3. **Bilingual comments** must be added for any new code. 4. **CI must pass** — the CI workflow runs format check, analyze, and tests on every PR. 5. **Keep PRs focused** — one feature/fix per PR makes review faster. diff --git a/README.md b/README.md index 0c1838f..9e11488 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ An in-app developer console for Flutter: inspect HTTP, WebSocket & gRPC traffic, [![Dart](https://img.shields.io/badge/Dart-✓-0175C2?logo=dart)](https://dart.dev) [![Style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://pub.dev/packages/effective_dart) -> **🔔 Upgrade recommended:** This release fixes an iOS correctness bug: the `lowMemory` field in `getProcessMemoryInfo` previously reported `ProcessInfo.isLowPowerModeEnabled` (Low Power / low-battery mode) instead of the actual low-memory state, mismatching Android/OHOS. It now reflects real system memory pressure via a `DispatchSource` memory-pressure monitor. All users are encouraged to upgrade to the latest version (`^1.14.1`). +> **🔔 Upgrade recommended:** This release adds Swift Package Manager (SPM) support for iOS (CocoaPods support is retained), and fixes iOS available-memory reporting: it was previously estimated as "device total memory minus this process RSS", which badly over-reported available memory, and now uses `os_proc_available_memory()`. All users are encouraged to upgrade to the latest version (`^1.15.0`). 🌐 **[Official Website](https://www.zerolabsco.com/)**  ·  📦 **[View on pub.dev](https://pub.dev/packages/zero_inspector_kit)**  ·  🔗 **[View on GitHub](https://github.com/zero-labsco/zero_inspector_kit)** @@ -102,7 +102,7 @@ An in-app developer console for Flutter: inspect HTTP, WebSocket & gRPC traffic, ```yaml dependencies: - zero_inspector_kit: ^1.14.1 + zero_inspector_kit: ^1.15.0 ``` ### GitHub @@ -112,7 +112,7 @@ dependencies: zero_inspector_kit: git: url: https://github.com/zero-labsco/zero_inspector_kit.git - ref: release/v1.14.1 # replace 1.14.1 with the version you need + ref: release/v1.15.0 # replace 1.15.0 with the version you need ``` --- diff --git a/README_zh.md b/README_zh.md index 46c1f8d..0a1c765 100644 --- a/README_zh.md +++ b/README_zh.md @@ -19,7 +19,7 @@ [![Dart](https://img.shields.io/badge/Dart-✓-0175C2?logo=dart)](https://dart.dev) [![Style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://pub.dev/packages/effective_dart) -> **🔔 推荐升级:** 本版本修复了 iOS 端的一个正确性问题:`getProcessMemoryInfo` 的 `lowMemory` 字段此前返回的是 `isLowPowerModeEnabled`(低电量 / 省电模式),而非真实的低内存状态,与 Android / OHOS 语义不符;现改用 `DispatchSource` 内存压力监听返回真实的系统内存压力状态。建议所有用户升级到最新版本(`^1.14.1`)。 +> **🔔 推荐升级:** 本版本新增 iOS 端 Swift Package Manager(SPM)支持(仍保留 CocoaPods),并修复 iOS 可用内存上报错误:此前按「设备总内存减去本进程 RSS」估算会严重高估可用内存,现改用 `os_proc_available_memory()`。建议所有用户升级到最新版本(`^1.15.0`)。 🌐 **[官方网站](https://www.zerolabsco.com/)**  ·  📦 **[在 pub.dev 查看](https://pub.dev/packages/zero_inspector_kit)**  ·  🔗 **[查看 GitHub 仓库](https://github.com/zero-labsco/zero_inspector_kit)** @@ -101,7 +101,7 @@ ```yaml dependencies: - zero_inspector_kit: ^1.14.1 + zero_inspector_kit: ^1.15.0 ``` ### GitHub @@ -111,7 +111,7 @@ dependencies: zero_inspector_kit: git: url: https://github.com/zero-labsco/zero_inspector_kit.git - ref: release/v1.14.1 # 将 1.14.1 替换为你需要的版本号 + ref: release/v1.15.0 # 将 1.15.0 替换为你需要的版本号 ``` --- diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 1ef278f..0000000 --- a/docs/404.html +++ /dev/null @@ -1 +0,0 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html deleted file mode 100644 index 1ef278f..0000000 --- a/docs/404/index.html +++ /dev/null @@ -1 +0,0 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/docs/Alerts/index.html b/docs/Alerts/index.html deleted file mode 100644 index 5119c74..0000000 --- a/docs/Alerts/index.html +++ /dev/null @@ -1,65 +0,0 @@ -
🔔 Alerts

Alerts / 告警系统

-

Overview / 概述

-
-

Available since v1.3.0

-

v1.3.0 起可用

-
-

The alert system lets you define rules that proactively surface problems across network requests, logs, memory, and FPS — without manually scanning the panels.

-

告警系统允许你定义规则,主动暴露网络请求、日志、内存、FPS 方面的问题,无需手动逐个面板排查。

-

How It Works / 工作原理

-
    -
  • Rules are evaluated by AlertService whenever a relevant event occurs / 每当相关事件发生时,AlertService 会评估规则
  • -
  • Matched rules produce alerts, and the unread count is exposed via a ValueNotifier<int> / 命中的规则会生成告警,未读数通过 ValueNotifier<int> 暴露
  • -
  • The floating button shows an unread-count badge; opening the panel clears it / 悬浮球显示未读数量角标,打开面板即清零
  • -
  • An Alerts tab in the inspector panel lists all triggered alerts / 检查器面板的 Alerts 标签页列出所有已触发的告警
  • -
-

Rule Types / 规则类型

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeTrigger / 触发条件Example / 示例
NetworkResponse status code / 响应状态码Alert when status ≥ 400 / 状态码 ≥ 400 时告警
LogLog level or message / 日志级别或内容Alert on error logs / 出现 error 日志时告警
MemoryDart heap / Native memory threshold / 内存阈值Alert when Dart heap > 100 MB / Dart 堆 > 100 MB 时告警
FPSFrame rate / 帧率Alert when FPS < 50 / FPS < 50 时告警
-

UI Features / UI 功能

-

Floating Button Badge / 悬浮球角标

-
    -
  • A red badge shows the current unread alert count (clamped 0–99) / 红色角标显示当前未读告警数(0–99)
  • -
  • The number is drawn inside the button so it is never clipped at screen edges / 数字直接绘制在按钮内部,吸附屏幕边缘时不会被裁切
  • -
  • Opening the inspector panel clears the unread count / 打开检查器面板即清零未读数
  • -
-

Alerts Tab / Alerts 标签页

-
    -
  • Lists triggered alerts with type, condition, and timestamp / 列出已触发告警的类型、条件与时间
  • -
  • Tap an alert to jump to the related panel (network / log / memory / FPS) / 点击告警可跳转到相关面板(网络 / 日志 / 内存 / FPS)
  • -
-

Notes / 备注

-
    -
  • Alerts are evaluated in-process and shown in the developer console only; they do not send data off-device / 告警仅在本机开发者控制台内评估与展示,不会将数据发送到设备外
  • -
  • Persisted to disk (since v1.11.0): triggered alerts are flushed to the SQLite ring buffer and replay into the Alerts tab after an app restart, and are included in the session archive export / 已落盘持久化(v1.11.0 起):已触发的告警会写入 SQLite 环形缓冲,重启后回放至 Alerts 标签页,并包含在会话存档导出中
  • -
  • The alert system is tree-shaken out in release builds, like the rest of the inspector / 与检查器其余部分一样,告警系统在 release 构建中被 tree-shake 移除
  • -

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Configuration/index.html b/docs/Configuration/index.html deleted file mode 100644 index 4268533..0000000 --- a/docs/Configuration/index.html +++ /dev/null @@ -1,570 +0,0 @@ -
⚙️ Configuration

Configuration / 配置说明

-

ZeroInspectorKit.init() Parameters / 初始化参数

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeDefaultDescription
enablebooltrueEnable inspector (auto false in release mode) / 启用检查器
enableLogCapturebooltrueEnable log capture / 启用日志捕获
enableNetworkCapturebooltrueEnable network interception / 启用网络拦截
enableErrorCapturebooltrueEnable error aggregation (Errors tab) / 启用异常聚合(Errors 标签页)
enablePersistencebooltruePersist logs/network/errors to a SQLite ring buffer; logs & errors replay on launch / 将日志/网络/异常落盘到 SQLite 环形缓冲,启动时回放日志与异常
enableFlutterLeakTrackerbooltrueBridge Flutter’s official MemoryAllocations as a second leak-detection source / 桥接 Flutter 官方 MemoryAllocations 作为泄漏检测第二来源
enableDatabaseScanbooltrueEnable database scan / 启用数据库扫描
enableRouteTrackingbooltrueEnable route tracking / 启用路由追踪
enableWidgetInspectorbooltrueEnable Widget tree snapshot / 启用 Widget 树快照
enableNetworkTimelinebooltruePrefer the network timeline (waterfall) in request details / 网络详情页默认展示时间轴(瀑布图)
customButtonWidget?nullCustom floating button widget / 自定义悬浮按钮
onLogCapturedvoid Function(LogEntry)?nullLog capture callback for third-party integration / 日志捕获回调
maxNetworkItemsint?100Network request cache cap / 网络请求缓存上限
maxLogItemsint?500Log entry cache cap / 日志条目缓存上限
maxRouteItemsint?200Route record cache cap / 路由记录缓存上限
maxBodyPreviewBytesint?32KBBody preview cap, longer bodies truncated / body 预览字节上限,超出截断
-
-

enableWidgetInspector / enableNetworkTimeline are also exposed on runAppWithInspector(). (wrapApp() takes only enable.)

-

enableWidgetInspector / enableNetworkTimeline 也可在 runAppWithInspector() 上设置(wrapApp() 仅接受 enable)。

-
-

Usage Examples / 使用示例

-

Disable Specific Features / 禁用特定功能

-
ZeroInspectorKit.init(
-  enableLogCapture: true,
-  enableNetworkCapture: false,  // Disable network monitoring / 禁用网络监控
-  enableDatabaseScan: true,
-  enableRouteTracking: false,   // Disable route tracking / 禁用路由追踪
-);
-

With Log Callback / 带日志回调

-
ZeroInspectorKit.init(
-  onLogCaptured: (entry) {
-    // Forward to your logging service / 转发到你的日志服务
-    myLogger.log(entry.message);
-  },
-);
-

ConditionalInspector / 条件检查器组件

-

A convenience widget that automatically shows/hides the inspector based on build mode.

-

根据构建模式自动显示/隐藏检查器的便利组件。

-
ConditionalInspector(
-  child: YourAppWidget(),
-)
- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeDefaultDescription
childWidgetrequiredChild widget / 子组件
enabledbooltrueEnable inspector / 启用检查器
-

FloatingInspectorButton / 悬浮检查器按钮

- - - - - - - - - - - - - - - - - -
ParameterTypeDefaultDescription
enabledbooltrueEnable button (auto false in release mode) / 启用按钮
-

InspectorLogInterceptor / 日志拦截器

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodDescription
start()Start capturing logs / 开始捕获日志
stop()Stop capturing logs / 停止捕获日志
log(level, message, tag)Add a log entry / 添加日志条目
verbose(message, tag)Add verbose log / 添加详细日志
debug(message, tag)Add debug log / 添加调试日志
info(message, tag)Add info log / 添加信息日志
warning(message, tag)Add warning log / 添加警告日志
error(message, tag)Add error log / 添加错误日志
- - - - - - - - - - - - - - - -
PropertyTypeDescription
onLogCapturedvoid Function(LogEntry)?Callback when a log is captured / 日志捕获回调
-

InspectorRouteObserver / 路由观察者

-

Navigator observer for tracking route changes. Auto-injected when using runAppWithInspector() or wrapApp().

-

用于追踪路由变化的 Navigator 观察者。使用 runAppWithInspector() 或 wrapApp() 时自动注入。

-
MaterialApp(
-  navigatorObservers: [InspectorRouteObserver()],
-  home: MyHomePage(),
-)
-

DatabaseRegistry / 数据库注册表

-

Register custom database providers:

-

注册自定义数据库提供者:

-
DatabaseRegistry.instance.registerProvider(SqliteDatabaseProvider());
-

See Custom Database Provider for more details.

-

详见 自定义数据库提供者。

-

InspectorLog / 简化日志 API

-
-

Available since v1.1.2 / v1.1.2 起可用

-
-

A static wrapper around InspectorLogInterceptor.instance for shorter log calls.

-

InspectorLogInterceptor.instance 的静态包装,用于更简短的日志调用。

-
InspectorLog.v('Verbose log');
-InspectorLog.d('Debug log');
-InspectorLog.i('Info log', tag: 'Auth');
-InspectorLog.w('Warning log');
-InspectorLog.e('Error log');
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodDescription
start()Start capturing logs / 开始捕获日志
stop()Stop capturing logs / 停止捕获日志
log(level, message, {tag})Add a log entry / 添加日志条目
v(message, {tag})Add verbose log / 添加详细日志
d(message, {tag})Add debug log / 添加调试日志
i(message, {tag})Add info log / 添加信息日志
w(message, {tag})Add warning log / 添加警告日志
e(message, {tag})Add error log / 添加错误日志
- - - - - - - - - - - - - - - -
PropertyTypeDescription
isRunningboolWhether log capture is currently active / 日志捕获是否正在运行
-

MemoryInspectorService / 内存监控服务

-
-

Available since v1.1.0 / v1.1.0 起可用

-
-

Singleton service for memory monitoring and leak detection, extends ChangeNotifier.

-

内存监控与泄漏检测单例服务,继承 ChangeNotifier。

-

Full API / 完整接口

-
// Leak tracking (full form) / 泄漏追踪(完整写法)
-MemoryInspectorService.instance.trackObject(
-  myController,
-  tag: 'HomeController_textController',
-  expectedReleaseAfter: const Duration(seconds: 30),
-);
-MemoryInspectorService.instance.untrackObject(myController);
-MemoryInspectorService.instance.clearLeakRecords();
-

Simplified API / 简化接口

-
-

Available since v1.1.2 / v1.1.2 起可用

-
-
// Extension method on Object / Object 上的扩展方法
-myBloc.trackMemoryLeak(tag: 'HomePage_myBloc');
- 
-// Top-level function / 顶层函数
-trackMemoryLeak(myBloc, tag: 'HomePage_myBloc');
- 
-// Cancel tracking / 取消追踪
-myBloc.untrackMemoryLeak();
-

See Memory Viewer for full feature details.

-

完整功能详情见 Memory Viewer。

-

Flutter MemoryAllocations Bridge / 官方泄漏追踪桥接

-
-

Available since v1.9.0 / v1.9.0 起可用

-
-

The leak detector’s own WeakReference state machine has a blind spot: an object whose dispose() ran but which has not been GC’d yet still resolves through the weak reference and is flagged as a suspected leak (false positive). LeakTrackerBridge subscribes to Flutter’s official FlutterMemoryAllocations (the data source behind leak_tracker) as a second source: once the official stream reports disposed, the object is treated as released (awaiting GC) even if the weak reference still resolves — cutting false positives.

-

自研泄漏检测的 WeakReference 状态机有一个盲点:对象已调用 dispose() 但尚未被 GC 时,弱引用仍存活,会被判定为”疑似泄漏”(误报)。LeakTrackerBridge 订阅 Flutter 官方的 FlutterMemoryAllocations(leak_tracker 背后的数据源)作为第二来源:只要官方上报了 disposed,即便弱引用仍存活也判定为已释放(等待 GC),从而显著降低误报。

-
    -
  • Enabled by default via ZeroInspectorKit.init()’s enableFlutterLeakTracker / 通过 init() 的 enableFlutterLeakTracker 默认启用
  • -
  • Official events only cover framework types that report to FlutterMemoryAllocations (Image / Picture / Layer …) — it supplements, not replaces, the custom detector / 官方事件只覆盖会上报给 FlutterMemoryAllocations 的框架类型(如 Image / Picture / Layer),因此是补充而非替代自研方案
  • -
-

ErrorService / 异常聚合服务

-
-

Available since v1.9.0 / v1.9.0 起可用

-
-

Singleton service for aggregated error capture, extends ChangeNotifier. Hooks FlutterError.onError (keeping the default red error behavior) and dedups each exception by type + stack signature. See Errors for full feature details.

-

异常聚合单例服务,继承 ChangeNotifier。接管 FlutterError.onError(保留默认红色报错行为),按类型 + 堆栈签名去重聚合。完整功能见 Errors。

-
// Report an exception manually (gRPC / custom protocols) / 手动上报异常
-ErrorService.instance.report(error, stackTrace, 'myModule');
- 
-// Read aggregated records (newest first) / 读取聚合记录(最新在前)
-final ErrorRecord r = ErrorService.instance.errors.first;
- 
-// Toggle capture / 切换抓取开关
-ErrorService.instance.isEnabled = false;
- 
-// Clear all records / 清空全部记录
-ErrorService.instance.clear();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberDescription
errorsList<ErrorRecord> — aggregated records, newest first / 聚合记录,最新在前
errorCountint — aggregated record count / 聚合记录条数
isEnabledbool — capture toggle (programmatic) / 抓取开关(代码控制)
report(exception, stack, [context])Manually report an exception / 手动上报异常
restore(records)Restore persisted records (replay on launch) / 恢复持久化记录(启动回放)
clear()Clear all aggregated records / 清空所有聚合记录
install() / uninstall()Hook / restore FlutterError.onError / 接管 / 还原 FlutterError.onError
-

PersistenceService / 持久化服务

-
-

Available since v1.9.0 / v1.9.0 起可用

-
-

Singleton service that async-flushes logs, network requests, and aggregated errors to a local SQLite ring buffer (zero_inspector_kit.db) so data survives app restarts. On launch, logs and aggregated errors replay into their tabs; network requests stay archived on disk for later export. Everything is guarded and degrades gracefully: if the DB is unavailable (e.g. desktop without sqflite FFI) isEnabled is false and writes become no-ops, never affecting the host app.

-

单例服务,将日志、网络请求与聚合异常异步落盘到本地 SQLite 环形缓冲(zero_inspector_kit.db),使数据跨重启不丢。启动时日志与聚合异常回放入各自标签页;网络请求保留在磁盘存档,供之后导出。所有操作都有保护并优雅降级:数据库不可用(如桌面端未配置 sqflite FFI)时 isEnabled 为 false,写入变为空操作,绝不影响宿主应用。

-

Tuning / 调参

-
await PersistenceService.instance.init(
-  maxRowsPerTable: 5000,                      // rows kept per table / 每表保留行数
-  retention: const Duration(days: 7),         // retention window / 保留时长
-  flushInterval: const Duration(seconds: 2),  // disk flush interval / 刷盘间隔
-);
-
-

Enabled by default via ZeroInspectorKit.init()’s enablePersistence — the ring buffer flushes automatically, so no manual init() call is needed in normal use.

-

通过 init() 的 enablePersistence 默认启用——环形缓冲会自动刷盘,常规使用无需手动调用 init()。

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberDescription
isEnabledbool — whether the DB is available / 数据库是否可用
maxRowsPerTableint — row cap per table (ring-buffer trim line) / 每表行数上限
enqueueLog(e) / enqueueNetwork(r) / enqueueError(e)Enqueue an item for async flush / 入队待异步落盘
flush()Flush the buffer to disk and trim / 刷盘并按环形缓冲裁剪
loadLogs() / loadErrors() / loadNetworkJson()Load persisted data, newest first / 读取已持久化数据(最新在前)
buildSessionArchiveJson()Build the full-session archive JSON (logs + errors + network) / 构建完整会话存档 JSON
exportSessionArchiveAndShare()Export & share the full-session archive via the system share sheet / 导出并分享完整会话存档
clearAll()Clear persisted data on disk / 清空磁盘上的持久化数据
dispose()Flush then close / 先刷盘再关闭
-

Persisted Data Manager / 持久化数据管理

-

Tap the storage icon in the panel header to open the Persisted data sheet: it shows the current row counts per category (logs / network / errors), the per-table cap, and whether the data will be replayed on the next launch. Actions:

-

点击面板头部的存储图标打开 Persisted data 管理弹层:展示各类别当前行数(logs / network / errors)、每表上限,以及下次启动是否会回放。支持的操作:

-
    -
  • Export & share session archive — share a JSON snapshot of the whole session / 导出并分享会话存档——分享本次会话完整 JSON 快照
  • -
  • Clear disk — wipe persisted rows so the next launch replays nothing / 清空磁盘——清空持久化数据,下次启动干净
  • -
  • Clear disk & lists — wipe disk and the in-memory lists together / 同时清空磁盘与列表——连同内存列表一并清空
  • -
-

FpsService / FPS 监控服务

-
-

Available since v1.2.0 / v1.2.0 起可用

-
-

Singleton service for FPS monitoring, extends ChangeNotifier.

-

FPS 监控单例服务,继承 ChangeNotifier。

-
FpsService.instance.start();
-FpsService.instance.stop();
-FpsService.instance.clear();
- 
-final fps = FpsService.instance.currentFps;
-final jankRate = FpsService.instance.jankRate;
- - - - - - - - - - - - - - - - - - - - - -
MethodDescription
start()Start FPS monitoring / 开始 FPS 监控
stop()Stop FPS monitoring / 停止 FPS 监控
clear()Clear all historical data and counters / 清空所有历史数据和计数器
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
isRunningboolWhether monitoring is currently active / 是否正在监控
currentFpsdoubleCurrent FPS (updated every 500ms) / 当前 FPS(每 500ms 更新)
jankRatedoubleJank rate as percentage / 卡顿率(百分比)
totalFrameCountintTotal frames captured / 总帧数
totalJankyCountintTotal janky frames (>16ms) / 总卡顿帧数(>16ms)
lastFrameJankyboolWhether the most recent frame was janky / 最近一帧是否卡顿
fpsHistoryList<double>Recent 60 FPS values (unmodifiable) / 最近 60 个 FPS 值(不可变)
frameRecordsList<FrameRecord>Recent frame records (unmodifiable, up to 3600) / 最近帧记录(不可变,最多 3600 条)
-

See FPS Viewer for full feature details.

-

完整功能详情见 FPS Viewer。


Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Custom-Database-Provider/index.html b/docs/Custom-Database-Provider/index.html deleted file mode 100644 index 5c83d98..0000000 --- a/docs/Custom-Database-Provider/index.html +++ /dev/null @@ -1,132 +0,0 @@ -
🔌 Custom Database Provider

Custom Database Provider / 自定义数据库提供者

-

Overview / 概述

-

Zero Inspector Kit supports extending database inspection beyond SQLite through the DatabaseProvider interface.

-

Zero Inspector Kit 通过 DatabaseProvider 接口支持扩展数据库检查功能到 SQLite 以外的数据库。

-

DatabaseProvider Interface / 接口定义

-
abstract class DatabaseProvider {
-  /// Provider name / 提供者名称
-  String get name;
- 
-  /// Get list of databases / 获取数据库列表
-  Future<List<DatabaseInfo>> getDatabases();
- 
-  /// Query table data / 查询表数据
-  Future<QueryResult> queryTable(String dbPath, String tableName, {int limit = 50});
-}
-

Data Models / 数据模型

-

DatabaseInfo

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
nameStringDatabase name / 数据库名称
pathStringDatabase file path / 数据库文件路径
tablesList<TableInfo>List of tables / 表列表
-

TableInfo

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
nameStringTable name / 表名
rowCountintRow count / 行数
-

QueryResult

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
columnsList<String>Column names / 列名
rowsList<Map<String, dynamic>>Row data / 行数据
-

Example: Custom Provider / 示例:自定义提供者

-
class MyCustomDatabaseProvider implements DatabaseProvider {
-  @override
-  String get name => 'CustomDB';
- 
-  @override
-  Future<List<DatabaseInfo>> getDatabases() async {
-    // Return your custom databases / 返回你的自定义数据库列表
-    return [
-      DatabaseInfo(
-        name: 'my_database',
-        path: '/path/to/my_database',
-        tables: [
-          TableInfo(name: 'users', rowCount: 100),
-          TableInfo(name: 'orders', rowCount: 500),
-        ],
-      ),
-    ];
-  }
- 
-  @override
-  Future<QueryResult> queryTable(
-    String dbPath,
-    String tableName, {
-    int limit = 50,
-  }) async {
-    // Execute query and return results / 执行查询并返回结果
-    return QueryResult(
-      columns: ['id', 'name', 'value'],
-      rows: [
-        {'id': 1, 'name': 'item1', 'value': '100'},
-        {'id': 2, 'name': 'item2', 'value': '200'},
-      ],
-    );
-  }
-}
-

Register Provider / 注册提供者

-
// Register your custom provider / 注册自定义提供者
-DatabaseRegistry.instance.registerProvider(MyCustomDatabaseProvider());
-

Built-in Provider / 内置提供者

-

The plugin includes SqliteDatabaseProvider which is auto-registered when enableDatabaseScan is true (default).

-

插件内置 SqliteDatabaseProvider,当 enableDatabaseScan 为 true(默认)时自动注册。

-

You can also register it manually:

-

也可以手动注册:

-
DatabaseRegistry.instance.registerProvider(SqliteDatabaseProvider());

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Database-Viewer/index.html b/docs/Database-Viewer/index.html deleted file mode 100644 index 4262151..0000000 --- a/docs/Database-Viewer/index.html +++ /dev/null @@ -1,59 +0,0 @@ -
💾 Database Viewer

Database Viewer / 数据库查看器

-

Overview / 概述

-

The Database Viewer inspects SQLite databases in your app with a two-level navigation system.

-

数据库查看器通过双层导航系统检查应用中的 SQLite 数据库。

-

Auto-Scan / 自动扫描

-

The inspector automatically scans the following directories for .db and .sqlite files:

-

检查器自动扫描以下目录中的 .db 和 .sqlite 文件:

-
    -
  • getApplicationDocumentsDirectory() / 应用文档目录
  • -
  • getDatabasesPath() / 数据库目录
  • -
-

Two-Level Navigation / 双层导航

-

Level 1: Database List (Global) / 第一层:数据库列表(全局)

-
    -
  • Shows all discovered databases / 显示所有发现的数据库
  • -
  • Each database shows name and table count / 每个数据库显示名称和表数量
  • -
  • Global search: Search database names and table names / 全局搜索:搜索数据库名和表名
  • -
-

Level 2: Database Detail / 第二层:数据库详情

-
    -
  • Click a database to enter its detail view / 点击数据库进入详情视图
  • -
  • Left panel: table list with row counts / 左侧面板:表列表(含行数)
  • -
  • Right panel: table data in DataTable format / 右侧面板:DataTable 格式的表数据
  • -
  • Back button to return to database list / 返回按钮返回数据库列表
  • -
  • In-database search: Search table names AND all column data / 数据库内搜索:搜索表名和所有列数据
  • -
-

Search / 搜索

- - - - - - - - - - - - - - - - - -
LevelSearch Scope
Global (database list)Database names, table names / 数据库名、表名
In-databaseTable names, all column values in all tables / 表名、所有表的所有列值
-

Search Highlights / 搜索高亮

-

When searching within a database, matching cell values are highlighted in accent color.

-

在数据库内搜索时,匹配的单元格值以强调色高亮显示。

-

UI Features / UI 功能

-
    -
  • Color-coded table icons / 带颜色的表图标
  • -
  • Row count badges for each table / 每个表的行数徽章
  • -
  • Selected table highlighted / 选中表高亮
  • -
  • Horizontal and vertical scrollable data table / 水平和垂直可滚动的数据表
  • -
  • Row count display (filtered / total) when searching / 搜索时显示行数(过滤/总数)
  • -
-

Custom Database Provider / 自定义数据库提供者

-

For non-SQLite databases, see Custom Database Provider.

-

对于非 SQLite 数据库,请参阅 自定义数据库提供者。


Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Errors/index.html b/docs/Errors/index.html deleted file mode 100644 index 42f70fb..0000000 --- a/docs/Errors/index.html +++ /dev/null @@ -1,163 +0,0 @@ -
🚨 Errors

Errors / 异常聚合查看器

-

Overview / 概述

-
-

Available since v1.9.0

-

v1.9.0 起可用

-
-

The Errors tab surfaces “the same crash happening repeatedly”. When the inspector is running, ErrorService hooks both FlutterError.onError and PlatformDispatcher.onError (keeping the default red-screen / console behavior for both) and aggregates every exception by type + stack signature. Repeated instances of the same crash merge into one record that shows how many times it occurred and when it was first/last seen — instead of flooding the log with hundreds of identical stack traces.

-

Errors 标签页用来快速发现”同一处崩溃反复出现”的问题。检查器运行时,ErrorService 会接管 FlutterError.onError(保留默认的红色报错与控制台行为),把每次异常按类型 + 堆栈签名去重聚合:同一处崩溃的多次发生会合并为一条记录,展示累计次数与首末次时间——而不是用成百上千条相同的堆栈刷屏日志。

-

What Gets Captured / 捕获来源

- - - - - - - - - - - - - - - - - - - - - - - - - -
Source / 来源How / 方式
Flutter framework errors / Flutter 框架异常Hooks FlutterError.onError (default handler kept) / 接管 FlutterError.onError(保留默认处理)
Framework-boundary & platform-channel errors / 框架边界外与平台通道异常PlatformDispatcher.onError (with save/restore) / PlatformDispatcher.onError(接管 + 还原)
Uncaught async errors / 未捕获异步异常runZonedGuarded inside runAppWithInspector() / runAppWithInspector() 内部的 runZonedGuarded
Manual reports / 手动上报ErrorService.instance.report(exception, stackTrace) — for gRPC / custom protocols / your own error paths / 用于 gRPC / 自定义协议或你自己的错误通道
-

Captured records are also persisted to disk (see Session Persistence below), so aggregated errors from previous sessions are replayed on the next launch.

-

捕获到的记录也会落盘持久化(见下文会话持久化),下次启动时会回放上次会话的聚合异常。

-

Deduplication / 去重规则

-
    -
  • Records are keyed by exception type plus a stack signature (first frames with line/address noise stripped) / 按异常类型 + 堆栈签名(取前若干帧并去掉行号/地址噪声)去重
  • -
  • A new occurrence of an existing signature bumps its count and updates lastSeen instead of adding a new row / 同签名的再次发生只累加 count 并更新 lastSeen,不新增行
  • -
  • Ring buffer capped at 200 aggregated records (oldest dropped) / 环形缓冲上限 200 条聚合记录(超出丢弃最旧)
  • -
-

UI Features / UI 功能

-

Errors Tab / Errors 标签页

-
    -
  • Lists aggregated errors newest-first, showing the exception type, message, first seen / last seen time, and a ×N badge when the same crash recurred / 按最新在前列出聚合异常,展示异常类型、消息、首次/末次出现时间,同崩溃复发时显示 ×N 徽章
  • -
  • Tap a row to expand the full stack sample (truncated at 8000 chars); tap again to collapse / 点击行展开完整堆栈样本(8000 字符截断);再点收起
  • -
  • Copy stack per row / 行内复制堆栈
  • -
  • Search filters by exception type or message / 搜索按异常类型或消息过滤
  • -
  • Clear empties the aggregated list / 清除清空聚合列表
  • -
-

Tab Badge / 标签页红点

-
    -
  • The Errors tab icon shows a red count badge while there are aggregated errors (capped at 99+), so recurring crashes are visible at a glance / Errors 标签页图标在有聚合异常时显示红色计数(99+ 封顶),一眼可见反复崩溃
  • -
  • Opening the Errors tab is not required to see the badge — it reflects ErrorService.instance.errorCount whenever the panel is open / 只要面板打开,标签红点即反映 ErrorService.instance.errorCount,无需先进入 Errors 页
  • -
-
-

Note: the floating ball itself stays clean — its red count (if any) is the Alerts unread badge (AlertService), not error aggregation.

-

注意:悬浮球本身保持纯粹——球上的红色数字(如有)来自告警未读数(AlertService),与异常聚合无关。

-
-

API / 接口

-

The full service is re-exported from the package root — no need to import lib/src/.

-

完整服务已从包根导出,无需 import lib/src/。

-
import 'package:zero_inspector_kit/zero_inspector_kit.dart';
- 
-// Report an exception manually (gRPC/custom protocol/your own error paths) / 手动上报异常
-ErrorService.instance.report(error, stackTrace, 'myModule');
- 
-// Read the aggregated view (newest first) / 读取聚合视图(最新在前)
-final ErrorRecord latest = ErrorService.instance.errors.first;
-print('${latest.type} x${latest.count} — first ${latest.firstSeen} / last ${latest.lastSeen}');
- 
-// Clear all records / 清空所有记录
-ErrorService.instance.clear();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MemberDescription
errorsList<ErrorRecord> — aggregated records, newest first / 聚合记录,最新在前
errorCountint — number of aggregated records / 聚合记录条数
isEnabledbool — capture toggle (programmatic) / 抓取开关(代码控制)
report(exception, stack, [context])Manually report an exception / 手动上报异常
restore(records)Restore persisted records (replay on launch; existing dedup ids are skipped) / 恢复持久化记录(启动回放;已存在的去重 id 跳过)
clear()Clear all aggregated records / 清空全部记录
install() / uninstall()Hook / restore FlutterError.onError and PlatformDispatcher.onError / 接管 / 还原 FlutterError.onError 与 PlatformDispatcher.onError
-

ErrorRecord / 异常记录

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
typeException type name (e.g. _TypeError) / 异常类型名
messageException message / 异常消息
countTotal occurrences / 累计出现次数
firstSeen / lastSeenFirst / last occurrence time / 首次 / 末次出现时间
sampleStackOne full stack sample (may be truncated) / 一条完整堆栈样本(可能截断)
-

Session Persistence / 会话持久化

-

Errors — together with logs, network requests and alerts — are asynchronously flushed to a local SQLite ring buffer (zero_inspector_kit.db). On the next launch, logs, aggregated errors and alerts replay into their tabs, so a crash you saw yesterday is still inspectable today even though the panel was never opened; network requests stay archived on disk for later export. Use the storage icon in the panel header to open the Persisted data manager: see the current row counts, export the full session archive as JSON, or clear the disk. See Configuration (PersistenceService section) for details and the tuning parameters.

-

异常与日志、网络请求、告警一起被异步写入本地 SQLite 环形缓冲(zero_inspector_kit.db)。下次启动时,日志、聚合异常与告警会回放入各自标签页——即使昨天从没打开过面板,今天依然能复盘当时的崩溃现场;网络请求保留在磁盘存档,供之后导出。点击面板头部的存储图标可打开 Persisted data 管理弹层:查看当前行数、导出完整会话存档 JSON,或清空磁盘。详见 Configuration(PersistenceService 一节)的参数说明。

-

Enable / Disable / 开关

-
    -
  • enableErrorCapture (default true) in ZeroInspectorKit.init() controls error aggregation / init() 的 enableErrorCapture(默认 true)控制异常聚合
  • -
  • enablePersistence (default true) controls the disk ring buffer / enablePersistence(默认 true)控制磁盘环形缓冲
  • -
  • Set both to false to keep everything in memory only / 两者都设为 false 时数据仅保留在内存
  • -
-
ZeroInspectorKit.init(
-  enableErrorCapture: true,
-  enablePersistence: true,   // false → memory-only / 关闭后仅内存
-);
- -
    -
  • Log Viewer — raw log stream including error lines / 原始日志流(含错误行)
  • -
  • Configuration — init parameters and full service APIs / 初始化参数与完整服务接口
  • -
  • Usage — general usage guide / 使用指南
  • -

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/FAQ/index.html b/docs/FAQ/index.html deleted file mode 100644 index b0ac158..0000000 --- a/docs/FAQ/index.html +++ /dev/null @@ -1,135 +0,0 @@ -
❓ FAQ

FAQ / 常见问题

-

General / 通用

-

Q: Does the inspector affect production builds? / 检查器会影响生产构建吗?

-

A: No. The inspector is automatically disabled in release mode via kReleaseMode. Flutter’s tree-shaking removes all inspector-related code from production builds. You don’t need to remove any code.

-

不会。 检查器在 release 模式下通过 kReleaseMode 自动禁用。Flutter 的 tree-shaking 会移除所有检查器相关代码,无需手动移除。

-
-

Q: What platforms are supported? / 支持哪些平台?

-

A: Android and iOS.

-

支持 Android 和 iOS。

-
-

Q: What Flutter/Dart versions are required? / 需要什么 Flutter/Dart 版本?

-

A: Flutter >= 3.3.0, Dart SDK >= 3.11.0 < 4.0.0.

-

Flutter >= 3.3.0,Dart SDK >= 3.11.0 < 4.0.0。

-
-

Network / 网络

-

Q: Do I need to manually add interceptors for Dio? / 需要为 Dio 手动添加拦截器吗?

-

A: No. Dio uses IOHttpClientAdapter internally, which uses dart:io’s HttpClient. The inspector captures all requests via HttpOverrides automatically, making it truly zero-invasion for both http package and Dio.

-

不需要。 Dio 内部使用 IOHttpClientAdapter,底层使用 dart:io 的 HttpClient。检查器通过 HttpOverrides 自动捕获所有请求,对 http 包和 Dio 都是真正的零侵入。

-
-

Q: Why do I see duplicate Dio requests? / 为什么看到重复的 Dio 请求?

-

A: If you use both InspectorDioInterceptor and the auto-capture (HttpOverrides), Dio requests will be recorded twice. Simply remove the manual InspectorDioInterceptor — auto-capture handles everything.

-

如果同时使用了 InspectorDioInterceptor 和自动捕获(HttpOverrides),Dio 请求会被记录两次。移除手动 InspectorDioInterceptor 即可,自动捕获会处理一切。

-
-

Q: Can I modify requests during testing? / 测试时可以修改请求吗?

-

A: Yes (since v1.0.7). The inspector supports intercepting and modifying requests via rules. Open a request detail and tap the Interceptor icon to configure a rule. You can modify the request body and request headers only — response fields (status code, response body) are read-only (since v1.0.8). GET requests cannot be modified (no request body). The master toggle is on the Network list page; rules only apply when modification mode is enabled.

-

可以(v1.0.7 起)。检查器支持通过规则拦截并修改请求。打开请求详情,点击拦截器图标配置规则。仅可修改请求体和请求头——响应字段(状态码、响应体)只读(v1.0.8 起)。GET 请求不可修改(无请求体)。总开关在 Network 列表页,规则仅在启用修改模式时生效。

-

See Network Inspector > Request Interceptor for details.

-

详见 Network Inspector > 请求拦截修改。

-
-

Logging / 日志

-

Q: Can I use my existing logging library? / 可以使用现有的日志库吗?

-

A: Yes! The inspector automatically captures logs from any library that uses print() or debugPrint(). No configuration needed. Third-party logs are categorized as Info level.

-

可以! 检查器会自动捕获任何使用 print() 或 debugPrint() 的日志库的日志,无需配置。第三方日志统一归类为 Info 级别。

-
-

Q: How to sync inspector logs to my logger? / 如何将检查器日志同步到我的日志库?

-

A: Use the onLogCaptured callback:

-

使用 onLogCaptured 回调:

-
InspectorLogInterceptor.instance.onLogCaptured = (entry) {
-  yourLogger.log(entry.message);
-};
-
-

Warning: Do NOT call print() or logging methods inside this callback, as it will cause infinite recursion. -警告:不要在此回调中调用 print() 或日志方法,否则会导致无限递归。

-
-
-

Database / 数据库

-

Q: Why don’t I see any databases? / 为什么看不到数据库?

-

A: The inspector scans getApplicationDocumentsDirectory() and getDatabasesPath() for .db and .sqlite files. If your database is stored elsewhere, you can implement a custom DatabaseProvider.

-

检查器扫描 getApplicationDocumentsDirectory() 和 getDatabasesPath() 目录中的 .db 和 .sqlite 文件。如果你的数据库存储在其他位置,可以实现自定义 DatabaseProvider。

-
-

Memory / 内存

-

Q: Why does Dart Heap show “N/A” when debugging via PC? / 通过 PC 调试时为什么 Dart Heap 显示 “N/A”?

-

A: This is an expected behavior. When using flutter run to debug via PC, the flutter tool sets up port forwarding between PC and device via adb reverse, allowing PC-side DevTools to access the device’s VM Service. However, Service.getInfo() returns a serverUri from the PC’s perspective; when the app process internally accesses 127.0.0.1:PC_port, the device doesn’t have that port listening locally, resulting in Connection refused and VM Service showing OFF.

-

这是预期行为。 使用 flutter run 连接 PC 调试时,flutter tool 会通过 adb reverse 在 PC 和设备之间做端口转发,让 PC 上的 DevTools 能访问设备的 VM Service。但应用进程内部 Service.getInfo() 返回的 serverUri 是 PC 视角的端口,应用进程访问 127.0.0.1:PC端口 时设备本地并没有监听该端口,导致 Connection refused,VM Service 显示 OFF。

-

Workarounds / 解决方案:

-
    -
  • Open the debug app directly without PC connection — VM Service works normally / 直接打开 debug 应用(不连 PC),VM Service 正常工作
  • -
  • Use Native memory data (Android PSS / iOS physicalFootprint) as fallback — always available / 使用 Native 内存数据(Android PSS / iOS physicalFootprint)作为降级,始终可用
  • -
  • Process RSS is always available regardless of VM Service / 进程 RSS 无论 VM Service 状态都可用
  • -
-

See Memory Viewer > VM Service Availability for details.

-

详见 Memory Viewer > VM Service 可用性。

-
-

Q: Does memory monitoring affect performance? / 内存监控会影响性能吗?

-

A: Memory monitoring is off by default (since v1.1.0). When disabled, all timers are stopped and VM Service connection is cleared, leaving zero overhead. When enabled, refresh intervals are optimized:

-

内存监控默认关闭(v1.1.0 起)。关闭时所有定时器停止、VM Service 连接清空,零开销。开启时刷新间隔已优化:

-
    -
  • Process RSS / Dart Heap: 500ms
  • -
  • Native Memory: 3000ms
  • -
  • Storage Stats: 3000ms
  • -
  • Leak Detection: 2000ms
  • -
-

You can toggle the switch at the top of the Memory panel anytime.

-

可随时在 Memory 面板顶部切换开关。

-
-

Q: Does leak detection require code modification? / 泄漏检测需要侵入代码吗?

-

A: The current implementation uses WeakReference + Finalizer, which requires calling trackObject() to register objects for tracking. This is a mild invasion (one line of code per tracked object).

-

当前实现使用 WeakReference + Finalizer,需要调用 trackObject() 注册要追踪的对象。这是轻度侵入(每个追踪对象一行代码)。

-

Trade-offs / 取舍:

-
    -
  • Pros: 100% reliable, doesn’t depend on VM Service, works in release mode / 100% 可靠,不依赖 VM Service,release 模式也可用
  • -
  • Cons: Requires user to know which objects to track / 需要用户知道要追踪哪些对象
  • -
-

A zero-invasion Heap Snapshot comparison feature (based on VM Service) is technically possible but would strongly depend on VM Service availability (unavailable when debugging via PC), with significant performance overhead. Not currently implemented.

-

零侵入的 Heap Snapshot 对比功能(基于 VM Service)技术上可行,但会强依赖 VM Service 可用性(PC 调试时不可用),且有显著性能开销。目前未实现。

-

See Memory Viewer > Memory Leak Detection for API details.

-

详见 Memory Viewer > 内存泄漏检测 了解 API 详情。

-
-

FPS / 帧率

-

Q: Why does FPS show a very low value (e.g. 9-10 FPS)? / 为什么 FPS 显示很低(如 9-10)?

-

A: This was a bug fixed in v1.2.0. The root cause was that _recentFrameTimestamps.add(now) was placed outside the for-loop in _onFrameTimings; since Flutter engine’s addTimingsCallback is batched (may return multiple frames per call), only one timestamp was recorded per batch, undercounting FPS by 6-10x. Upgrade to ^1.2.0 to fix this.

-

这是 v1.2.0 已修复的 bug。根因是 _onFrameTimings 中 _recentFrameTimestamps.add(now) 在 for 循环外;Flutter 引擎的 addTimingsCallback 是批量回调(一次可能返回多帧),但每批只记录 1 个时间戳,导致 FPS 计算偏低 6-10 倍。升级到 ^1.2.0 即可修复。

-

See FPS Viewer for details.

-

详见 FPS Viewer。

-
-

Q: Does FPS monitoring affect performance? / FPS 监控会影响性能吗?

-

A: FPS monitoring is off by default (since v1.2.0). When disabled, no frame timings callbacks and no timers — zero overhead. When enabled, it only processes lightweight frame timing data with bounded history (60 trend points, up to 3600 frame records). You can toggle the switch at the top of the FPS panel anytime.

-

FPS 监控默认关闭(v1.2.0 起)。关闭时无帧回调、无定时器——零开销。开启时仅处理轻量帧时序数据,历史有界(趋势 60 个点,帧记录最多 3600 条)。可随时在 FPS 面板顶部切换开关。

-
-

UI / 界面

-

Q: The inspector panel gets pushed up when keyboard appears. / 键盘弹出时检查器面板被顶起来了。

-

A: This was fixed in v1.0.6. The floating button and panel are rendered via Overlay, which is independent of the page layout and not affected by keyboard.

-

此问题已在 v1.0.6 修复。悬浮按钮和面板通过 Overlay 渲染,独立于页面布局,不受键盘影响。

-
-

Q: How to use search? / 如何使用搜索?

-

A: Each viewer has its own search bar at the top. Database viewer has two-level search: global search (database list) and in-database search (table names + all column data).

-

每个查看器顶部都有搜索栏。数据库查看器有双层搜索:全局搜索(数据库列表)和数据库内搜索(表名 + 所有列数据)。

-
-

Q: The floating button disappeared / can’t be opened after enabling FPS. / 开启 FPS 后悬浮按钮消失/无法打开。

-

A: This was a bug fixed in v1.2.0. The root cause was that FpsService.notifyListeners() triggered Overlay rebuild; combined with the original Overlay lookup failure (using Overlay.of(context, rootOverlay: true) which returned null), the button State was destroyed and could not recover. Upgrade to ^1.2.0 which uses navigatorState.overlay instead.

-

这是 v1.2.0 已修复的 bug。根因是 FpsService.notifyListeners() 触发 Overlay 重建,叠加原 Overlay 查找失败(使用 Overlay.of(context, rootOverlay: true) 返回 null),导致按钮 State 被销毁且无法恢复。升级到 ^1.2.0,改用 navigatorState.overlay 即可。

-
-

Q: How does the floating button edge docking work? / 悬浮按钮的边缘吸附怎么用?

-

A: Since v1.2.0, when you drag the button near a screen edge and release, it auto-docks and tucks into the edge, leaving only a 24px peek visible. The icon becomes a directional chevron hinting you can tap to pull it out:

-
    -
  • Tap the peek → smoothly pulls out to fully visible (panel NOT opened, avoids accidental open) / 平滑拉出到完全可见(不打开面板,避免误触)
  • -
  • Tap when fully visible → opens the inspector panel / 打开检查器面板
  • -
-

This design avoids conflicts with system back gestures (Android/iOS edge swipe to go back) when pulling out from the docked state.

-

v1.2.0 起,拖动按钮靠近屏幕边缘松手即自动吸附并”收入”边缘,仅露 24px。图标变为方向箭头,提示可点击拉出:

-
    -
  • 点击露出部分 → 平滑拉出到完全可见(不打开面板,避免误触)
  • -
  • 完全可见时点击 → 打开检查器面板
  • -
-

此设计避免了从吸附态拖出时与系统返回手势(Android/iOS 边缘右滑退出)的冲突。

-

See Usage > Edge Docking for details.

-

详见 Usage > 边缘吸附。

-
-

License / 许可证

-

Q: Can I use this in a commercial project? / 可以在商业项目中使用吗?

-

A: Yes. This project is licensed under MPL-2.0. You can use it in closed-source commercial apps — if you use it unmodified, no source disclosure is required. If you modify the plugin’s source files, those modified files must be published in source form under MPL-2.0 (your own app still does not need to be open-sourced).

-

可以。本项目采用 MPL-2.0 许可证,可用于闭源商业 App——未修改直接使用时无需公开任何源码;若修改了插件源文件,被修改的文件必须以 MPL-2.0 公开源码(你自己的 App 仍无需开源)。

-

Q: Are you liable for issues in modified versions? / 修改版出问题你们负责吗?

-

A: This plugin is provided “as is”, without warranty of any kind. The author assumes no responsibility or liability for the functionality, security, or any consequences arising from the use of modified versions or derivative projects.

-

本插件按”原样”提供,不提供任何担保。作者不对修改版或衍生项目的功能、安全性及任何使用后果承担责任。


Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/FPS-Viewer/index.html b/docs/FPS-Viewer/index.html deleted file mode 100644 index 78b44b0..0000000 --- a/docs/FPS-Viewer/index.html +++ /dev/null @@ -1,258 +0,0 @@ -
🎯 FPS Viewer

FPS Viewer / FPS 监控面板

-

The FPS Viewer provides real-time frame performance analysis, including current FPS, jank rate, frame duration stats, and an FPS trend chart.

-

FPS 监控面板提供实时帧性能分析,包括当前 FPS、卡顿率、帧耗时统计和 FPS 趋势图。

-
-

Available since v1.2.0

-

v1.2.0 起可用

-
-

Overview / 概览

-

The FPS Viewer is integrated into the inspector panel. Tap the floating inspector button → “FPS” tab to access.

-

FPS 监控面板集成在检查器面板中。点击悬浮检查器按钮 → “FPS” 标签即可访问。

-

⚠️ Important: FPS monitoring is off by default. You must toggle on the switch at the top of the panel to start collecting data.

-

⚠️ 重要:FPS 监控默认关闭。必须在面板顶部打开开关才会开始采集数据。

-

Master Switch / 总开关

-

A switch at the top of the FPS panel controls whether monitoring is enabled.

-

FPS 面板顶部有一个开关,控制是否启用监控。

- - - - - - - - - - - - - - - - - -
StateBehavior
OFF (default)No frame timings callbacks, no timer, zero overhead / 无帧回调、无定时器、零开销
ONStarts collecting frame data via WidgetsBinding.instance.addTimingsCallback / 通过 addTimingsCallback 开始采集帧数据
-

When turned off, all callbacks and timers are cancelled, leaving no residual overhead.

-

关闭时所有回调和定时器会被取消,不会残留开销。

-

Features / 功能

-

1. Current Stats / 当前统计

-
    -
  • Current FPS — Updated every 500ms / 每 500ms 更新
  • -
  • Jank Rate — Percentage of janky frames (duration exceeds the per-frame budget, derived from the display refresh rate) / 卡顿帧占比(帧耗时超过由屏幕刷新率换算的逐帧预算)
  • -
  • Total Frame Count — All frames captured since start / 自启动以来的总帧数
  • -
  • Total Janky Count — All janky frames captured / 自启动以来的总卡顿帧数
  • -
  • Last Frame Janky — Whether the most recent frame was janky / 最近一帧是否卡顿
  • -
-

显示当前 FPS、卡顿率、总帧数、总卡顿帧数、最近一帧是否卡顿。

-

2. FPS Trend Chart / FPS 趋势图

-
    -
  • Real-time line chart with 30-second history window (60 data points × 500ms)
  • -
  • Y-axis dynamically scales to max(60, maxFps) to avoid overflow when FPS spikes
  • -
  • Janky frame region marked in red
  • -
  • Time axis labels: -30s / -15s / Now
  • -
-

实时折线图,30 秒历史窗口(60 个数据点 × 500ms)。Y 轴动态缩放为 max(60, maxFps) 避免 FPS 飙升时溢出。卡顿区域以红色标记。

-

3. Janky Frame List / 卡顿帧列表

-
    -
  • Lists janky frames — duration exceeds the per-frame budget, derived from the display refresh rate (~16.7ms at 60Hz, ~8.3ms at 120Hz) / 列出卡顿帧——帧耗时超过由屏幕刷新率换算的逐帧预算(60Hz≈16.7ms、120Hz≈8.3ms)
  • -
  • Each item shows frame duration and timestamp, plus the build / raster split (buildDurationUs + rasterDurationUs) so you can tell whether build or GPU raster is the bottleneck / 每项显示帧耗时、时间戳,以及 build / raster 分项(buildDurationUs + rasterDurationUs),便于判断是构建还是 GPU 光栅化卡顿
  • -
  • Helps identify specific jank spikes / 帮助定位具体卡顿点
  • -
-

列出卡顿帧(帧耗时超过由屏幕刷新率换算的逐帧预算,60Hz≈16.7ms、120Hz≈8.3ms),每项显示帧耗时、时间戳与 build / raster 分项,帮助定位具体卡顿点。

-

4. Reset / 重置

-
    -
  • “Reset” button clears all statistics and historical data / “Reset” 按钮清空所有统计和历史数据
  • -
  • Useful for measuring a specific interaction scenario / 适合测量特定交互场景
  • -
-

“Reset” 按钮清空所有统计和历史数据,适合测量特定交互场景。

-

Main-thread Blocking Watchdog / 主线程阻塞看门狗

-

The FPS panel also includes a main-thread blocking watchdog that catches stalls FPS cannot see.

-

FPS 面板还内置主线程阻塞看门狗,专门捕捉 FPS 看不见的卡死。

-
-

Available since v1.12.0

-

v1.12.0 起可用

-
-

Why it’s needed / 为什么需要: FPS only measures frames. When the UI isolate truly stalls (e.g. a synchronous heavy computation), it produces zero frames, so FPS reads as idle while the app is actually frozen. The watchdog closes that blind spot.

-

FPS 只测帧。当 UI isolate 真正卡死(如同步重计算)时,它零帧产出,于是 FPS 显示空闲,而 App 其实已冻住。看门狗补上这个盲区。

-

How it works / 工作原理:

-
    -
  • A low-frequency 100ms heartbeat measures the UI isolate’s responsiveness directly / 用 100ms 低频心跳 直接测量 UI isolate 的响应间隔
  • -
  • If a gap exceeds 300ms with no response, it records a blocking event (duration / time / nearby logs) / 若超过 300ms 无响应,记录一条阻塞事件(时长 / 时间 / 附近日志)
  • -
  • Off by default with its own switch (not tied to the FPS master switch) — zero overhead unless you opt in / 默认关闭、有独立开关(不随 FPS 总开关联动),不开启则零开销
  • -
-

开启后,真正卡死(不产帧)也会被记成阻塞事件,配合 FPS 一起看因果。

-

How It Works / 工作原理

-

FPS monitoring uses Flutter’s WidgetsBinding.instance.addTimingsCallback to receive frame timing information from the engine. The callback is batched — it may return multiple FrameTiming objects per call, so each frame is recorded individually inside the loop to ensure accurate FPS calculation.

-

FPS 监控使用 Flutter 的 WidgetsBinding.instance.addTimingsCallback 接收引擎的帧时序信息。该回调是批量的——每次调用可能返回多个 FrameTiming 对象,因此在循环内部为每帧单独记录时间戳,确保 FPS 计算准确。

-

Jank threshold / 卡顿阈值: A frame is janky when its total duration (build + raster) exceeds the per-frame budget — 1000ms ÷ refreshRate (≈16.7ms at 60Hz, ≈8.3ms at 120Hz). Since v1.11.0 the budget is derived from the device’s refresh rate, so high-refresh (120Hz) screens are held to a tight ≈8.3ms instead of being forgiven by a fixed 16ms.

-

卡顿阈值:帧的总耗时(build + raster)超过逐帧预算即视为卡顿——1000ms ÷ 刷新率(60Hz≈16.7ms、120Hz≈8.3ms)。自 v1.11.0 起预算按设备刷新率换算,高刷(120Hz)屏会被严格约束在 ≈8.3ms,而非被固定 16ms 放过。

-

Phased timing / 分阶段耗时: Each FrameRecord carries buildDurationUs and rasterDurationUs (GPU raster); the janky-frame list shows the build / raster split per row.

-

分阶段耗时:每条 FrameRecord 都带有 buildDurationUs 与 rasterDurationUs(GPU 光栅化),掉帧列表项会展示 build / raster 分项。

-

Programmatic Control (Optional) / 编程式控制(可选)

-

If you need to start/stop monitoring from code (e.g., for automated testing), use FpsService:

-

如需从代码控制监控(如自动化测试),使用 FpsService:

-
// Start / Stop FPS monitoring / 开始 / 停止 FPS 监控
-FpsService.instance.start();
-FpsService.instance.stop();
- 
-// Read current stats / 读取当前统计
-final fps = FpsService.instance.currentFps;
-final jankRate = FpsService.instance.jankRate;
-final totalFrames = FpsService.instance.totalFrameCount;
-final jankyFrames = FpsService.instance.totalJankyCount;
- 
-// Clear historical data / 清空历史数据
-FpsService.instance.clear();
- 
-// Listen to updates / 监听更新
-FpsService.instance.addListener(() {
-  // Update your own UI / 更新你自己的 UI
-});
- 
-// Historical data access / 历史数据访问
-final history = FpsService.instance.fpsHistory;       // List<double>, 60 entries / 60 条
-final records = FpsService.instance.frameRecords;      // List<FrameRecord>, unmodifiable / 不可变,最多 3600 条
-

FpsService API / FpsService 接口

-

Singleton service extending ChangeNotifier.

-

继承 ChangeNotifier 的单例服务。

- - - - - - - - - - - - - - - - - - - - - -
MethodDescription
start()Start FPS monitoring / 开始 FPS 监控
stop()Stop FPS monitoring / 停止 FPS 监控
clear()Clear all historical data and counters / 清空所有历史数据和计数器
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescription
isRunningboolWhether monitoring is currently active / 是否正在监控
currentFpsdoubleCurrent FPS (updated every 500ms) / 当前 FPS(每 500ms 更新)
jankRatedoubleJank rate as percentage / 卡顿率(百分比)
totalFrameCountintTotal frames captured / 总帧数
totalJankyCountintTotal janky frames captured (per-frame budget) / 总卡顿帧数(按逐帧预算)
lastFrameJankyboolWhether the most recent frame was janky / 最近一帧是否卡顿
fpsHistoryList<double>Recent 60 FPS values (unmodifiable) / 最近 60 个 FPS 值(不可变)
frameRecordsList<FrameRecord>Recent frame records (unmodifiable, up to 3600) / 最近帧记录(不可变,最多 3600 条)
-

Performance Considerations / 性能说明

-
    -
  • Off by default / 默认关闭: Zero overhead when disabled / 关闭时零开销
  • -
  • Lightweight callbacks / 轻量回调: Only processes frame timing data, no heavy computation / 仅处理帧时序数据,无重计算
  • -
  • Bounded history / 有界历史: Trend chart keeps only 60 points, frame records capped at 3600 / 趋势图仅保留 60 个点,帧记录上限 3600 条
  • -
  • Safe with other features / 与其他功能兼容: Can run alongside Memory Viewer monitoring / 可与 Memory Viewer 监控同时运行
  • -
-

Platform Support / 平台支持

- - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidiOS
FPS Monitoring✅✅
Jank Detection✅✅
Trend Chart✅✅
-
-

FPS monitoring uses Flutter engine APIs and works on Android and iOS (the two platforms this plugin targets).

-

FPS 监控使用 Flutter 引擎 API,在本插件支持的两个平台 Android 与 iOS 上均可用。

-
-

Demo / 演示

-

The Example App includes an FPS demo module with three scenarios:

-

Example App 包含 FPS 演示模块,提供三种场景:

- - - - - - - - - - - - - - - - - - - - - -
DemoDescription
Trigger JankBlocks the main thread for 100-500ms to simulate jank / 阻塞主线程 100-500ms 模拟卡顿
Heavy Animations80 simultaneously rotating+scaling widgets to intentionally trigger jank / 80 个同时旋转+缩放的 widget 故意触发卡顿
Smooth AnimationSingle lightweight compound animation, demonstrates stable 60 FPS / 单个轻量复合动画,演示稳定 60 FPS
- -
    -
  • Usage — General usage guide / 通用使用指南
  • -
  • FAQ — Common questions / 常见问题
  • -
  • Configuration — Configuration options / 配置选项
  • -

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Getting-Started/index.html b/docs/Getting-Started/index.html deleted file mode 100644 index 6f9d25a..0000000 --- a/docs/Getting-Started/index.html +++ /dev/null @@ -1,91 +0,0 @@ -
🚀 Getting Started

Getting Started / 快速开始

-

Quick Start / 快速开始

-

Integrate with just 1 line of code:

-

仅需 1 行代码 即可完成集成:

-
import 'package:flutter/material.dart';
-import 'package:zero_inspector_kit/zero_inspector_kit.dart';
- 
-void main() {
-  // Single line: Initialize inspector, capture print() via Zone, and display floating button
-  // 一行代码:初始化检查器、通过 Zone 捕获 print()、自动显示悬浮按钮
-  ZeroInspectorKit.runAppWithInspector(const MyApp());
-}
- 
-class MyApp extends StatelessWidget {
-  const MyApp({super.key});
- 
-  @override
-  Widget build(BuildContext context) {
-    return MaterialApp(
-      home: Scaffold(
-        appBar: AppBar(title: const Text('App')),
-        body: const Center(child: Text('Hello World')),
-      ),
-    );
-  }
-}
-

What Happens Automatically / 自动完成的工作

-

After integration, the inspector automatically does the following without modifying any other project code:

-

集成后,检查器会自动完成以下工作,无需修改项目其他代码:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureDescription
✅ Log CaptureAuto-capture all print(), debugPrint() via Zone / 通过 Zone 自动捕获所有日志
✅ Network InterceptionAuto-intercept all http and Dio requests via HttpOverrides / 自动拦截所有网络请求
✅ Error CaptureAggregate Flutter framework errors & unhandled exceptions, deduped by type + stack (Errors tab) / 聚合 Flutter 框架异常与未捕获异常,按类型+堆栈去重
✅ Session PersistenceFlush logs/network/errors to a disk ring buffer; logs & errors replay on next launch / 日志/网络/异常落盘环形缓冲,启动时回放日志与异常
✅ Database ScanAuto-scan and register SQLite databases / 自动扫描注册数据库
✅ Floating ButtonAuto-displayed via Overlay, not affected by keyboard / 通过 Overlay 自动显示
✅ Route TrackingAuto-inject InspectorRouteObserver into MaterialApp / 自动注入路由观察者
-
-

Note / 说明: The Memory and FPS panels are available as tabs but are off by default to avoid performance overhead. Toggle the switch at the top of each panel to start collecting data. See Memory Viewer and FPS Viewer for details.

-

Memory 和 FPS 面板作为标签页可用,但默认关闭以避免性能开销。在各自面板顶部打开开关才会开始采集数据。详见 Memory Viewer 和 FPS Viewer。

-
-
-

Pre-initialized binding / 提前初始化的 binding: If you call WidgetsFlutterBinding.ensureInitialized() or await a platform-channel plugin (e.g. SharedPreferences) before runAppWithInspector(), the binding is already initialized. In that case runAppWithInspector() degrades gracefully to a plain runApp() (capturing debugPrint logs, but not raw print()) instead of throwing a “Zone mismatch” assertion. No extra setup is needed.

-

binding 已提前初始化:如果你在 runAppWithInspector() 之前调用了 WidgetsFlutterBinding.ensureInitialized() 或 await 了会触发 platform channel 的插件(如 SharedPreferences),binding 已被初始化。此时 runAppWithInspector() 会优雅降级为普通 runApp()(仍捕获 debugPrint 日志,但不捕获原始 print()),而非抛出 “Zone mismatch” 断言。无需额外处理。

-
-

Production Build / 生产构建

-

The inspector is automatically disabled in release mode. You don’t need to remove any code — Flutter’s tree-shaking will remove all inspector-related code from production builds.

-

检查器在 release 模式下会自动禁用,无需移除任何代码,Flutter 的 tree-shaking 会自动移除所有检查器相关代码。

-

Alternative Integration / 替代集成方式

-

If you prefer more control, use the two-line approach:

-

如果需要更多控制权,可以使用两行代码方式:

-
void main() {
-  ZeroInspectorKit.init();
-  runApp(ZeroInspectorKit.wrapApp(const MyApp()));
-}
-

Next Steps / 下一步

-
    -
  • Installation — Detailed installation methods / 详细安装方式
  • -
  • Usage — Full usage guide / 完整使用指南
  • -
  • Configuration — Configuration options / 配置选项
  • -

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Installation/index.html b/docs/Installation/index.html deleted file mode 100644 index ca1fe7a..0000000 --- a/docs/Installation/index.html +++ /dev/null @@ -1,50 +0,0 @@ -
📦 Installation

Installation / 安装

- -

Add the following to your pubspec.yaml:

-

在 pubspec.yaml 中添加以下依赖:

-
dependencies:
-  zero_inspector_kit: ^1.14.1
-

Then run:

-

然后运行:

-
flutter pub get
-

From GitHub / 从 GitHub 安装

-

Alternatively, install from GitHub:

-

或者从 GitHub 安装:

-
dependencies:
-  zero_inspector_kit:
-    git:
-      url: https://github.com/zero-labsco/zero_inspector_kit.git
-      ref: release/v1.14.1
-

Platform Setup / 平台配置

-

Android

-

No additional configuration needed.

-

无需额外配置。

-

iOS

-

No additional configuration needed.

-

无需额外配置。

-

Import / 导入

-
import 'package:zero_inspector_kit/zero_inspector_kit.dart';
-

Requirements / 环境要求

- - - - - - - - - - - - - - - - - -
RequirementVersion
Flutter>= 3.3.0
Dart SDK>= 3.11.0 < 4.0.0
-

Next Steps / 下一步

-
    -
  • Getting Started — Quick start guide / 快速开始
  • -
  • Usage — Full usage guide / 完整使用指南
  • -

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Log-Viewer/index.html b/docs/Log-Viewer/index.html deleted file mode 100644 index 1922be0..0000000 --- a/docs/Log-Viewer/index.html +++ /dev/null @@ -1,165 +0,0 @@ -
📝 Log Viewer

Log Viewer / 日志查看器

-

Overview / 概述

-

The Log Viewer automatically captures logs from multiple sources with zero configuration.

-

日志查看器自动从多个来源捕获日志,无需配置。

-

Log Sources / 日志来源

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SourceCapture Method
print()Zone specification override / Zone 规范覆盖
debugPrint()debugPrint override / debugPrint 覆盖
Flutter errorsFlutterError.onError hook / 接管 FlutterError.onError
Unhandled exceptionsrunZonedGuarded / runZonedGuarded 捕获
Third-party librariesVia print() capture / 通过 print() 捕获
-
-

Since v1.9.0, Flutter framework errors and unhandled exceptions are also aggregated & deduplicated in the dedicated Errors tab (keyed by type + stack signature) — while this Log Viewer keeps showing them as error-level lines in the chronological stream. Use Errors for “is this crash repeating?”; use Log Viewer for the raw timeline.

-

自 v1.9.0 起,Flutter 框架异常与未捕获异常会同时进入独立的 Errors 标签页去重聚合(按类型 + 堆栈签名归并);本 Log Viewer 仍会在原始时间流中把它们显示为错误级日志。回答”该崩溃是否反复出现”请用 Errors;查看原始时间线请用 Log Viewer。

-
-

Log Levels / 日志级别

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LevelAbbreviationColorDescription
VerboseVGrayDetailed information / 详细信息
DebugDBlueDebug information / 调试信息
InfoIGreenGeneral information / 一般信息
WarningWOrangeWarning messages / 警告信息
ErrorERedError messages / 错误信息
-
-

Third-party library logs are categorized as Info level.

-
-
-

第三方日志库的日志统一归类为 Info 级别。

-
-

UI Features / UI 功能

-

Filter Bar / 过滤栏

-
    -
  • All: Show all logs / 使用 All 显示所有日志
  • -
  • V / D / I / W / E: Filter by level / 按级别过滤
  • -
  • Tag dropdown: Filter by any captured tag / 按任意已捕获标签过滤
  • -
  • Single-select mode / 单选模式
  • -
-

Toolbar / 工具栏

-
    -
  • Auto-scroll toggle (default on): Jump to the newest log as new entries arrive; pause to keep history still for inspection / 自动滚动开关(默认开启):新日志到达时自动跳到最新;暂停可稳定查看历史
  • -
  • Copy as JSON: Copy all currently filtered logs as JSON / 复制为 JSON:将当前过滤后的全部日志复制为 JSON
  • -
  • Share as Text: Share filtered logs as plain text / 分享为文本:将过滤后的日志以纯文本分享
  • -
  • Clear: Clear all logs / 清除:清空全部日志
  • -
-

Log List / 日志列表

-
    -
  • Level badge with color / 带颜色的级别徽章
  • -
  • Timestamp display / 时间戳显示
  • -
  • Tag display (if available) / 标签显示(如有)
  • -
  • Error/warning rows have subtle background tint / 错误/警告行有淡色背景
  • -
  • Left border color indicates level / 左侧边框颜色表示级别
  • -
  • Tap a row to open the in-view detail page with full message and copy; use the back button to return / 点击行进入详情页(主视图内切换),可查看完整消息并复制,点返回按钮回到列表
  • -
  • Per-row copy button copies that single log as JSON / 行内复制按钮将该条日志以 JSON 复制
  • -
-

Search / 搜索

-
    -
  • Fuzzy search by message content or tag / 按消息内容或标签模糊搜索
  • -
  • Toggle regex mode (. * button) to search with RegExp (case-insensitive); invalid patterns degrade gracefully instead of crashing / 点击 正则模式(. * 按钮)使用 RegExp 搜索(不区分大小写);非法图案优雅降级,不会崩溃
  • -
  • Combined with level and tag filters / 可与级别、标签过滤组合使用
  • -
-

Manual Logging / 手动记录日志

-

Quick shorthand (recommended) / 简化写法(推荐) — available since v1.1.2 / v1.1.2 起可用:

-
InspectorLog.v('Verbose message / 详细消息');
-InspectorLog.d('Debug message / 调试消息');
-InspectorLog.i('Info message / 信息消息');
-InspectorLog.w('Warning message / 警告消息');
-InspectorLog.e('Error message / 错误消息');
- 
-// With tag / 带标签
-InspectorLog.i('User logged in', tag: 'Auth');
-

Full form / 完整写法:

-
InspectorLogInterceptor.instance.verbose('Verbose message / 详细消息');
-InspectorLogInterceptor.instance.debug('Debug message / 调试消息');
-InspectorLogInterceptor.instance.info('Info message / 信息消息');
-InspectorLogInterceptor.instance.warning('Warning message / 警告消息');
-InspectorLogInterceptor.instance.error('Error message / 错误消息');
- 
-// With tag / 带标签
-InspectorLogInterceptor.instance.info('User logged in', tag: 'Auth');
-

InspectorLog is a static wrapper around InspectorLogInterceptor.instance for shorter log calls.

-

InspectorLog 是 InspectorLogInterceptor.instance 的静态包装,用于更简短的日志调用。

-

Third-Party Library Integration / 第三方日志库集成

-

Auto-Capture (Inbound) / 自动捕获(入站)

-

No configuration needed. Any library using print() or debugPrint() is automatically captured.

-

无需配置。任何使用 print() 或 debugPrint() 的库都会被自动捕获。

-

Bidirectional Sync (Optional) / 双向同步(可选)

-

To forward inspector logs to your third-party logger:

-

将检查器日志转发到第三方日志库:

-
import 'package:logger/logger.dart';
- 
-final logger = Logger();
- 
-InspectorLogInterceptor.instance.onLogCaptured = (entry) {
-  logger.log(
-    _mapLogLevel(entry.level),
-    '${entry.tag != null ? '[${entry.tag}] ' : ''}${entry.message}',
-  );
-};
-
-

Note: Do NOT call logging methods inside onLogCaptured, as this will cause infinite recursion. -注意:不要在 onLogCaptured 内部调用日志方法,否则会导致无限递归。

-
-

Starting the Log Interceptor / 启动日志拦截器

-

If using runAppWithInspector(), the log interceptor starts automatically. Otherwise:

-

如果使用 runAppWithInspector(),日志拦截器会自动启动。否则:

-
InspectorLogInterceptor.instance.start();

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Memory-Viewer/index.html b/docs/Memory-Viewer/index.html deleted file mode 100644 index 69fee4a..0000000 --- a/docs/Memory-Viewer/index.html +++ /dev/null @@ -1,265 +0,0 @@ -
📊 Memory Viewer

Memory Viewer / 内存监控面板

-

The Memory Viewer provides comprehensive in-app memory analysis, including trend charts, Dart Heap details, Native memory breakdown, memory leak detection, image cache monitoring, and storage statistics.

-

内存监控面板提供应用内全面内存分析,包括趋势图、Dart Heap 详情、Native 内存分项、内存泄漏检测、图片缓存监控和存储统计。

-
-

Available since v1.1.0

-

v1.1.1 起可用

-
-

Overview / 概览

-

The Memory Viewer is integrated into the inspector panel. Tap the floating inspector button → “Memory” tab to access.

-

内存监控面板集成在检查器面板中。点击悬浮检查器按钮 → “Memory” 标签即可访问。

-

⚠️ Important: Memory monitoring is off by default. You must toggle on the switch at the top of the panel to start collecting data.

-

⚠️ 重要:内存监控默认关闭。必须在面板顶部打开开关才会开始采集数据。

-

Master Switch / 总开关

-

A switch at the top of the Memory panel controls whether monitoring is enabled.

-

Memory 面板顶部有一个开关,控制是否启用监控。

- - - - - - - - - - - - - - - - - -
StateBehavior
OFF (default)No timers, no VM Service connection, zero overhead / 无定时器、无 VM Service 连接、零开销
ONStarts RSS collection (500ms), Native memory (3s), storage stats (3s), leak detection (2s), and VM Service connection attempt / 启动 RSS 采集(500ms)、Native 内存(3s)、存储统计(3s)、泄漏检测(2s),并尝试连接 VM Service
-

When turned off, all timers are cancelled and the VM Service connection state is cleared, leaving no residual WebSocket overhead.

-

关闭时所有定时器会被取消,VM Service 连接状态会被清空,不会残留 WebSocket 开销。

-

Features / 功能

-

1. Memory Trend Chart / 内存趋势图

-
    -
  • Real-time line chart with 2-minute history window (240 snapshots × 500ms)
  • -
  • Switchable between 4 metrics via the metric selector chips: -
      -
    • Process RSS — Process-level RSS (always available)
    • -
    • Dart Heap — Total Dart Heap usage (requires VM Service)
    • -
    • New Space — New generation usage (requires VM Service)
    • -
    • Old Space — Old generation usage (requires VM Service)
    • -
    -
  • -
-

实时折线图,2 分钟历史窗口(240 条快照 × 500ms)。可通过指标选择芯片切换 4 种指标。

-

2. Native Memory / Native 内存(真机 100% 可用)

-

Does not depend on VM Service. Data is collected via Platform Channel:

-

不依赖 VM Service,通过 Platform Channel 采集:

-

Android (Debug.MemoryInfo + /proc/self/status):

-
    -
  • Total PSS / Dalvik PSS / Native PSS / Native Private Dirty
  • -
  • Process RSS (from /proc/self/status)
  • -
  • Device memory status (availMem, threshold, lowMemory)
  • -
-

iOS (mach task_info):

-
    -
  • Physical Footprint (Apple’s recommended metric)
  • -
  • Internal / Compressed / Resident Size
  • -
  • Process RSS
  • -
  • Device available memory
  • -
-

3. Dart Heap Overview / Dart Heap 概览(需要 VM Service)

-
    -
  • Heap Usage / Capacity / external usage
  • -
  • Progress bar showing heap usage ratio
  • -
  • Three core metrics with bilingual labels
  • -
-

显示 Heap Usage / Capacity / External 三个核心指标 + 进度条。

-

4. Heap Generations / 堆分代详情(需要 VM Service)

-
    -
  • New Space: usage / capacity / external
  • -
  • Old Space: usage / capacity / external
  • -
  • Helps identify allocation patterns (frequent new-space churn vs old-space growth)
  • -
-

显示新生代/老生代的 Usage / Capacity / External 详细数据。

-

5. Manual GC / 手动触发 GC(需要 VM Service)

-
    -
  • “Trigger GC” button forces a full garbage collection
  • -
  • Disabled (grayed out) when VM Service is unavailable
  • -
-

“Trigger GC” 按钮强制触发完整垃圾回收。VM Service 不可用时按钮变灰禁用。

-

6. Memory Leak Detection / 内存泄漏检测

-

Based on Dart 2.17+ WeakReference and Finalizer. Does NOT depend on VM Service.

-

基于 Dart 2.17+ 的 WeakReference 和 Finalizer,不依赖 VM Service。

-

Four-state transition / 四状态流转:

- - - - - - - - - - - - - - - - - - - - - - - - - -
StateMeaning
trackingObject registered, waiting for expected release time / 对象已注册,等待预期释放时间
verifyingExceeded expected release time, GC verification triggered (if VM Service available) / 超过预期释放时间,触发 GC 验证(VM Service 可用时)
leakedObject still exists after GC — suspected leak / GC 后对象仍存在——疑似泄漏
releasedObject has been garbage collected / 对象已被垃圾回收
-

API / 接口:

-

Quick shorthand (recommended) / 简化写法(推荐) — available since v1.1.2 / v1.1.2 起可用:

-
// Extension method on Object / Object 上的扩展方法
-myBloc.trackMemoryLeak(tag: 'HomePage_myBloc');
- 
-// Or top-level function / 或使用顶层函数
-trackMemoryLeak(myBloc, tag: 'HomePage_myBloc');
- 
-// Cancel tracking / 取消追踪
-myBloc.untrackMemoryLeak();
-

Full form / 完整写法:

-
// Register an object for leak tracking / 注册对象进行泄漏追踪
-MemoryInspectorService.instance.trackObject(
-  myController,
-  tag: 'HomeController_textController',  // optional identifier
-  expectedReleaseAfter: const Duration(seconds: 30),  // expected release time
-);
- 
-// Stop tracking a specific object / 停止追踪特定对象
-MemoryInspectorService.instance.untrackObject(myController);
- 
-// Clear all records / 清空所有记录
-MemoryInspectorService.instance.clearLeakRecords();
-

Limits / 限制:

-
    -
  • Max 500 tracked objects (LRU eviction)
  • -
  • Detection interval: 2 seconds
  • -
  • trackObject() requires user code modification (mild invasion)
  • -
-
-

Flutter MemoryAllocations bridge (since v1.9.0) / 官方泄漏追踪桥接(v1.9.0 起)

-

The WeakReference state machine has a blind spot: an object whose dispose() ran but that has not been GC’d yet still resolves through the weak reference, producing a false “leaked” verdict. Since v1.9.0, MemoryInspectorService also subscribes to Flutter’s official FlutterMemoryAllocations (the data source behind leak_tracker) via LeakTrackerBridge: once the official stream reports disposed, the object is treated as released (awaiting GC) even if the weak reference still resolves — cutting false positives. Enabled by default through enableFlutterLeakTracker in init(), and toggled in code via MemoryInspectorService.instance.flutterLeakTrackerEnabled.

-

WeakReference 状态机有一个盲点:对象已调用 dispose() 但尚未被 GC 时弱引用仍存活,会产生”疑似泄漏”的误报。v1.9.0 起,MemoryInspectorService 通过 LeakTrackerBridge 额外订阅 Flutter 官方的 FlutterMemoryAllocations(leak_tracker 背后的数据源):只要官方上报 disposed,即便弱引用仍存活也判定为已释放(等待 GC),从而显著降低误报。由 init() 的 enableFlutterLeakTracker 默认启用,也可用 MemoryInspectorService.instance.flutterLeakTrackerEnabled 在代码中开关。

-
-

7. Image Cache / 图片缓存

-
    -
  • Real-time Flutter image cache size and count
  • -
  • Pending (loading) / Live (in use) image counts
  • -
  • One-click clear all image cache
  • -
-

实时显示 Flutter 图片缓存大小、数量、加载中/使用中状态。一键清理图片缓存。

-

8. App Storage / 应用存储

-
    -
  • Documents directory size
  • -
  • Temp cache directory size
  • -
  • Total database file size
  • -
  • One-click clear temp cache
  • -
-

显示文档目录、临时缓存、数据库文件大小。一键清理临时缓存。

-

⚠️ VM Service Availability / VM Service 可用性

-

Dart Heap data and manual GC require VM Service connection. When VM Service is unavailable, these features gracefully degrade to show “N/A”.

-

Dart Heap 数据和手动 GC 需要 VM Service 连接。 VM Service 不可用时,这些功能优雅降级显示 “N/A”。

-

When debugging via PC with flutter run / 通过 PC 用 flutter run 调试时

-

Dart VM Heap data may be unavailable (VM: OFF).

-

Dart VM Heap 数据可能不可用(VM: OFF)。

-

Reason / 原因: When using flutter run to debug via PC, the flutter tool sets up port forwarding between PC and device via adb reverse, allowing PC-side DevTools to access the device’s VM Service. However, Service.getInfo() returns a serverUri from the PC’s perspective; when the app process internally accesses 127.0.0.1:PC_port, the device doesn’t have that port listening locally, resulting in Connection refused and VM Service showing OFF.

-

原因:使用 flutter run 连接 PC 调试时,flutter tool 会通过 adb reverse 在 PC 和设备之间做端口转发,让 PC 上的 DevTools 能访问设备的 VM Service。但应用进程内部 Service.getInfo() 返回的 serverUri 是 PC 视角的端口,应用进程访问 127.0.0.1:PC端口 时设备本地并没有监听该端口,导致 Connection refused,VM Service 显示 OFF。

-

When opening debug app directly (no PC) / 直接打开 debug 应用(不连 PC)

-

VM Service works normally. No flutter tool is involved, VM Service listens directly on the device’s local port, the app can connect normally, and Dart Heap data displays correctly.

-

VM Service 正常工作。 没有 flutter tool 介入,VM Service 直接监听设备本地端口,应用能正常连接,Dart Heap 数据正常显示。

-

Fallback / 降级方案

-

When VM Service is unavailable:

-
    -
  • ✅ Native memory (Android PSS / iOS physicalFootprint) — still available
  • -
  • ✅ Process RSS — always available
  • -
  • ✅ Image cache / storage stats — still available
  • -
  • ✅ Leak detection — still available (doesn’t depend on VM Service)
  • -
  • ❌ Dart Heap details — shows N/A
  • -
  • ❌ Manual GC — button disabled
  • -
-

Platform Support / 平台支持

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidiOS
Process RSS✅✅
Native Memory✅✅
Dart Heap (VM Service)✅ (no PC)✅ (no PC)
Manual GC✅ (no PC)✅ (no PC)
Leak Detection✅✅
Image Cache✅✅
Storage Stats✅✅
-

Refresh Intervals / 刷新间隔

- - - - - - - - - - - - - - - - - - - - - - - - - -
Data SourceInterval
Process RSS / Dart Heap500ms
Native Memory (Android/iOS)3000ms
Storage Stats3000ms
Leak Detection2000ms
- -

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Network-Inspector/index.html b/docs/Network-Inspector/index.html deleted file mode 100644 index fd12c80..0000000 --- a/docs/Network-Inspector/index.html +++ /dev/null @@ -1,333 +0,0 @@ -
🌐 Network Inspector

Network Inspector / 网络检查器

-

Overview / 概述

-

The Network Inspector automatically captures all HTTP requests made via the http package and Dio, with zero configuration needed.

-

网络检查器自动捕获所有通过 http 包 和 Dio 发送的 HTTP 请求,无需任何配置。

-

How It Works / 工作原理

-

The inspector uses Flutter’s HttpOverrides to intercept all HTTP traffic at the dart:io level. This means:

-

检查器通过 Flutter 的 HttpOverrides 在 dart:io 层面拦截所有 HTTP 流量。这意味着:

-
    -
  • http package: Auto-captured ✅ / 自动捕获 ✅
  • -
  • Dio: Auto-captured (uses IOHttpClientAdapter → HttpClient) ✅ / 自动捕获 ✅
  • -
  • No manual interceptor setup needed / 无需手动添加拦截器
  • -
-

WebSocket & gRPC Capture / WebSocket 与 gRPC 抓取

-
-

Available since v1.7.0 (opt-in, off by default)

-

v1.7.0 起可用(可选开启,默认关闭)

-
-

HTTP/HTTPS traffic is captured automatically, but the HttpOverrides interceptor does not cover streaming protocols like WebSocket and gRPC. For those, enable the opt-in capture so frames and calls show up as WS / gRPC rows in the Network tab.

-

HTTP/HTTPS 流量会自动捕获,但 HttpOverrides 拦截器无法覆盖 WebSocket、gRPC 这类流式协议。针对它们需开启可选的抓取,开启后收发帧/调用会以 WS / gRPC 行的形式出现在 Network 标签页。

-

Enable / 开启方式

-
    -
  • Toggle the WS switch in the Network tab toolbar, or / 在 Network 标签页工具栏点击 WS 开关,或
  • -
  • Set it programmatically: / 通过代码开启:
  • -
-
// on / 开启
-WsInspectorService.instance.enable();
-// off / 关闭
-WsInspectorService.instance.disable();
-

Capture is off by default and only records while enabled — apps that don’t use these protocols pay nothing.

-

抓取默认关闭,且只在开启时记录;不使用这类协议的应用零开销。

-

Two Usage Modes / 两种使用方式

-

1. Transparent wrapper — InspectorWebSocket

-

Replace WebSocket.connect with InspectorWebSocket.connect. Frames are auto-recorded (→ out, ← in) when capture is on; when off it passes through with zero overhead.

-

将 WebSocket.connect 替换为 InspectorWebSocket.connect。开启抓取时会自动记录收发帧(→ 出站、← 入站);关闭时零开销透传。

-
final ws = await InspectorWebSocket.connect('wss://echo.websocket.events');
-ws.listen((msg) => print('received: $msg'));
-ws.add('hello'); // recorded as an outgoing frame / 记录为出站帧
-

2. Manual hook — recordCall

-

For stacks not transparently interceptable by dart:io (gRPC, web_socket_channel, custom protocols), call recordCall to log a request/response pair. No-ops when capture is disabled.

-

对于无法被 dart:io 透明拦截的栈(gRPC、web_socket_channel、自定义协议),调用 recordCall 记录一次请求/响应。关闭抓取时为空操作。

-
WsInspectorService.instance.recordCall(
-  name: 'user.UserService/GetUser',
-  request: '{ "id": 1 }',
-  response: '{ "name": "Ada" }',
-  protocol: 'gRPC', // appears in the method column / 显示在 method 列
-);
-

What You See / 查看方式

-
    -
  • Network tab lists a WS (or gRPC) entry per connection/call / Network 标签页按连接/调用列出 WS(或 gRPC)记录
  • -
  • Open the detail view to see the frame log (outgoing → / incoming ←), accumulated in the response body / 进入详情页查看帧日志(出站 → / 入站 ←),累积显示在响应体中
  • -
  • A [connection closed] marker is appended when the socket closes / 连接关闭后会追加 [connection closed] 标记
  • -
-

Captured Information / 捕获的信息

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldDescription
MethodGET, POST, PUT, DELETE, PATCH
URLFull request URL
Status CodeHTTP response status code
DurationRequest duration
Request HeadersAll request headers
Request BodyRequest payload (JSON formatted)
Response BodyResponse payload (JSON formatted)
HostParsed from URL
-

UI Features / UI 功能

-

Request List / 请求列表

-
    -
  • Color-coded by HTTP method / 按 HTTP 方法着色
  • -
  • Status code badge / 状态码徽章
  • -
  • Duration display / 耗时显示
  • -
  • Left border color indicates status / 左侧边框颜色表示状态
  • -
-

Request Detail / 请求详情

-
    -
  • Click a request to enter detail view / 点击请求进入详情视图
  • -
  • Back button to return to list / 返回按钮返回列表
  • -
  • Request and response sections / 请求和响应分段显示
  • -
  • JSON formatted body / JSON 格式化显示
  • -
-

Search / 搜索

-
    -
  • Fuzzy search by URL or method / 按 URL 或方法模糊搜索
  • -
  • Search bar hidden in detail view / 详情视图隐藏搜索栏
  • -
-

Batch Operations / 批量操作

-
-

Available since v1.3.0

-

v1.3.0 起可用

-
-

The request list supports a selection mode for operating on multiple requests at once.

-

请求列表支持选择模式,可一次性操作多条请求。

-
    -
  • Tap the selection icon in the toolbar to enter selection mode / 点击工具栏的选择图标进入选择模式
  • -
  • Check/uncheck items; a top batch bar shows Select all / Cancel / 勾选/取消勾选;顶部批量条提供全选 / 取消
  • -
  • Batch “Copy as cURL”: copies all selected requests as cURL commands / 批量「Copy as cURL」:将所有选中请求复制为 cURL 命令
  • -
  • Batch delete: removes selected requests from the list / 批量删除:从列表中移除选中请求
  • -
-

Export & Sensitive-field Masking / 导出与敏感字段遮蔽

-
-

Available since v1.3.0

-

v1.3.0 起可用

-
-

The toolbar includes an eye toggle that controls whether sensitive headers are masked on export.

-

工具栏包含眼睛开关,控制导出时是否遮蔽敏感请求头。

-
    -
  • Default: off (fully visible) — cURL / JSON / HAR reflect the real request verbatim / 默认关闭(完整可见):cURL / JSON / HAR 原样反映真实请求
  • -
  • On: toCurl / netToJson / netToHar / copyNet / exportNetToFile mask these headers / 开启后:以下请求头被遮蔽: -
      -
    • Authorization, Cookie, Set-Cookie, Proxy-Authorization, X-Auth-Token, X-CSRF-Token, X-XSRF-Token
    • -
    -
  • -
  • The detail page “Copy as cURL” / “Copy as JSON” follow the same toggle / 详情页「Copy as cURL」「Copy as JSON」跟随同一开关
  • -
  • When masking is active, the snackbar notes (sensitive hidden) / 遮蔽开启时,snackbar 提示 (sensitive hidden)
  • -
-
-

Tip: keep masking on before pasting cURL/JSON into terminals, chat, or issue trackers to avoid leaking credentials.

-

提示:将 cURL/JSON 粘贴到终端、聊天或 issue 前,建议开启遮蔽,避免凭据泄露。

-
-

Copy as cURL / 复制为 cURL

-
-

Available since v1.3.0

-

v1.3.0 起可用

-
-

From the request detail view, tap Copy as cURL to copy the request as a ready-to-run cURL command (method, URL, headers, body). Respects the sensitive-field masking toggle above.

-

在请求详情页点击 Copy as cURL,即可将请求复制为可直接运行的 cURL 命令(方法、URL、请求头、请求体),并遵循上方的敏感字段遮蔽开关。

-

Replay Editor / 重放编辑器

-
-

Available since v1.11.0

-

v1.11.0 起可用

-
-

Every request detail view has a replay action (↻ icon). It opens an editable sheet that lets you re-issue the captured request in-app and preview the response — handy for quickly re-running an endpoint without leaving the app.

-

每个请求详情页都有重放操作(↻ 图标)。它会打开一个可编辑弹层,让你在 App 内重新发出该请求并预览响应——无需离开应用即可快速复跑某个接口。

-
    -
  • Only the URL query parameters are editable — add / edit / remove key=value rows; the URL is rebuilt from them on send / 仅 URL 查询参数可编辑——可增删改 key=value 行,发送时用其重建 URL
  • -
  • URL, request headers and request body are read-only by design (the captured values are re-sent verbatim) / URL、请求头与请求体按设计只读(以捕获到的原值原样重发)
  • -
  • On Send, the request is re-issued with the original method / headers / body and the edited query string; the sheet shows the returned status code, elapsed time, and a response preview / 点击 Send 后用原始方法 / 请求头 / 请求体加上修改后的查询串重新发出,弹层展示返回状态码、耗时与响应预览
  • -
-
-

This is distinct from the interceptor (which builds a durable modification rule applied to future matching requests). The replay editor makes a one-off call with editable query params — including GET requests, whose params can’t be changed by the interceptor.

-

它与拦截器不同(拦截器生成作用于后续匹配请求的持久规则)。重放编辑器发起的是一次性调用,仅查询参数可改——包括 GET 请求(其参数拦截器无法修改)。

-
-

Status Code Colors / 状态码颜色

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RangeColorDescription
2xxGreenSuccess / 成功
3xxBlueRedirect / 重定向
4xxOrangeClient error / 客户端错误
5xxRedServer error / 服务器错误
-

HTTP Method Colors / HTTP 方法颜色

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodColor
GETBlue / 蓝色
POSTGreen / 绿色
PUTOrange / 橙色
DELETERed / 红色
PATCHPurple / 紫色
-

Usage Example / 使用示例

-
// http package - auto-captured / http 包 - 自动捕获
-final response = await http.get(
-  Uri.parse('https://api.example.com/data'),
-);
- 
-// Dio - auto-captured / Dio - 自动捕获
-final response = await dio.post(
-  'https://api.example.com/data',
-  data: {'key': 'value'},
-);
-

No additional setup required! All requests will appear in the Network tab.

-

无需额外配置!所有请求都会出现在 Network 标签页中。

-

Request Interceptor / 请求拦截修改

-
-

Available since v1.0.7 (response fields locked to read-only since v1.0.8)

-

v1.0.7 起可用(v1.0.8 起响应字段锁定为只读)

-
-

The inspector supports intercepting and modifying network requests via rules. This is useful for testing different request parameters without modifying app code.

-

检查器支持通过规则拦截并修改网络请求,适合在不修改应用代码的情况下测试不同的请求参数。

-

Workflow / 工作流程

-
    -
  1. Send a request normally (it will be captured in the Network panel) / 正常发送请求(会被捕获到 Network 面板)
  2. -
  3. Open the request detail and tap the Interceptor icon / 打开请求详情,点击拦截器图标
  4. -
  5. Configure the modification rule (URL pattern, HTTP method, request modifications) / 配置修改规则(URL 模式、HTTP 方法、请求修改)
  6. -
  7. Save the rule — subsequent matching requests will use the modified parameters / 保存规则——后续匹配的请求将使用修改后的参数
  8. -
-

Supported Modifications / 支持的修改

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldEditableNotes
Request Body✅Only for requests with body (POST, PUT, PATCH, etc.) / 仅适用于有 body 的请求
Request Headers✅Add / modify / remove headers / 新增 / 修改 / 删除请求头
URL❌Grayed out, read-only / 灰色不可编辑
Response Status Code❌Read-only since v1.0.8 / v1.0.8 起只读
Response Body❌Read-only since v1.0.8 / v1.0.8 起只读
-
-

The interception edit panel only allows modifying the request body and request headers. Response fields (status code, response body) are grayed out and uneditable.

-

拦截编辑面板仅允许修改请求体和请求头。响应字段(状态码、响应体)灰色不可编辑。

-
-

Rule Matching / 规则匹配

-
    -
  • URL pattern matching: exact match or regex / URL 模式匹配:精确匹配或正则匹配
  • -
  • HTTP method filtering: GET, POST, PUT, DELETE, PATCH, HEAD, or Any / HTTP 方法过滤
  • -
-

Why GET Requests Cannot Be Modified / 为什么 GET 请求不能修改

-
    -
  • The interceptor currently supports modifying request body and headers only / 拦截器目前仅支持修改请求体和请求头
  • -
  • GET requests don’t have a request body / GET 请求没有请求体
  • -
  • Modifying GET request parameters would require URL modification / 修改 GET 请求参数需要修改 URL
  • -
  • URL modification may cause unexpected issues with request routing and parameter encoding / 修改 URL 可能导致请求路由和参数编码的意外问题
  • -
-
-

GET request detail pages do not display interception edit buttons, making them unmodifiable.

-

GET 请求详情页不显示拦截编辑按钮,因此无法修改。

-
-

Master Toggle / 拦截总开关

-
    -
  • The interception master toggle is displayed only on the Network list page, not in the detail page / 拦截总开关只显示在 Network 列表页,不在详情页
  • -
  • Rules are only applied when modification mode is enabled / 规则仅在启用修改模式时生效
  • -
  • When no rules are configured or rules are disabled, all requests are sent normally without any modification / 未配置规则或禁用规则时,所有请求正常发送,不做任何修改
  • -
-

Rule Management / 规则管理

-

The network panel includes an interceptor rule editor where you can:

-

网络面板包含拦截规则编辑器,可以:

-
    -
  • Create / edit / delete rules / 创建 / 编辑 / 删除规则
  • -
  • Enable / disable individual rules / 启用 / 禁用单条规则
  • -
  • View rule status indicators in the request list / 在请求列表中查看规则状态标识
  • -

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Route-Tracker/index.html b/docs/Route-Tracker/index.html deleted file mode 100644 index 1788542..0000000 --- a/docs/Route-Tracker/index.html +++ /dev/null @@ -1,65 +0,0 @@ -
🧭 Route Tracker

Route Tracker / 路由追踪

-

Overview / 概述

-

The Route Tracker monitors navigation history, recording all route push, pop, and replacement events.

-

路由追踪器监控导航历史,记录所有路由 push、pop 和替换事件。

-

Auto-Injection / 自动注入

-

When using runAppWithInspector() or wrapApp(), the InspectorRouteObserver is automatically injected into MaterialApp’s navigatorObservers.

-

使用 runAppWithInspector() 或 wrapApp() 时,InspectorRouteObserver 会自动注入到 MaterialApp 的 navigatorObservers 中。

-

Tracked Route Actions / 追踪的路由操作

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ActionColorDescription
pushBlueNavigator.push() / 推入新路由
pushNamedBlueNavigator.pushNamed() / 按名称推入
popOrangeNavigator.pop() / 弹出路由
popUntilOrangeNavigator.popUntil() / 弹出直到
pushReplacementPurpleNavigator.pushReplacement() / 替换路由
-

UI Features / UI 功能

-

Route List / 路由列表

-
    -
  • Action badge with color / 带颜色的操作徽章
  • -
  • Route name display / 路由名称显示
  • -
  • Timestamp display / 时间戳显示
  • -
  • Left border color indicates action type / 左侧边框颜色表示操作类型
  • -
-

Route Detail / 路由详情

-
    -
  • Click a route to view details / 点击路由查看详情
  • -
  • Shows: Action, Route Name, Timestamp, Arguments / 显示:操作、路由名、时间戳、参数
  • -
  • Arguments displayed as formatted JSON / 参数以 JSON 格式显示
  • -
-

Manual Setup (Optional) / 手动设置(可选)

-

If you use a custom Navigator or don’t use MaterialApp, add the observer manually:

-

如果使用自定义 Navigator 或不使用 MaterialApp,请手动添加观察者:

-
MaterialApp(
-  navigatorObservers: [InspectorRouteObserver()],
-  home: MyHomePage(),
-)

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Timeline/index.html b/docs/Timeline/index.html deleted file mode 100644 index 73b4d39..0000000 --- a/docs/Timeline/index.html +++ /dev/null @@ -1,44 +0,0 @@ -
🧵 Timeline

Timeline / 统一会话时间线

-

Overview / 概述

-

The Timeline tab merges network, logs, errors, routes, and alerts into a single time-ordered stream, so you can see the full causal chain of a session at a glance — e.g. “route push → two requests → error log → 5xx alert”. Each source keeps its own data; the Timeline view only merges them for display.

-

统一会话时间线把网络、日志、异常、路由、告警归并为一条按时间排序的流,让你一眼看清一次会话的完整因果链——例如「路由跳转 → 两个请求 → error 日志 → 5xx 告警」。各来源的数据仍归属各自服务,时间线视图只做归并显示。

-
-

Available since v1.12.0

-

v1.12.0 起可用

-
-

Where to find it / 入口

-

Tap the floating inspector button → the Timeline tab (located after Routes and before Widgets in the panel).

-

点击悬浮检查器按钮 → Timeline 标签页(位于面板中 Routes 之后、Widgets 之前)。

-

Features / 功能

-

1. Merged stream / 归并流

-
    -
  • Network / Logs / Errors / Routes / Alerts appear interleaved by timestamp / 网络 / 日志 / 异常 / 路由 / 告警按时间戳交错排列
  • -
  • Each entry shows its source icon, a colored left accent bar, timestamp, and a concise summary / 每条显示来源图标、左侧彩色强调条、时间戳与精炼摘要
  • -
  • Tap any entry to expand details (e.g. request URL/status, log level/message, route action/name) / 点击任意条目展开详情(如请求 URL/状态、日志级别/内容、路由操作/名称)
  • -
-

把五类数据按时间归并,每条带来源图标、彩色强调条、时间戳与摘要,可点击展开。

-

2. Per-source filtering / 逐来源筛选

-
    -
  • Toggle each source on/off to focus on the ones you care about / 逐来源开关,只看关心的来源
  • -
  • Filtering only hides entries from the merged view; underlying data is untouched / 筛选只隐藏归并视图中的条目,底层数据不受影响
  • -
-

顶部可按来源开关自由筛选,归并显示内容随之变化,底层数据不变。

-

3. Focus ±N seconds / ±N 秒聚焦

-
    -
  • Tap any event to enter “focus” mode: the view keeps only events within ±N seconds of the anchor / 点击任意事件进入「聚焦」模式,仅保留锚点前后 ±N 秒内的事件
  • -
  • Window selector: 5s / 10s (default) / 30s / 窗口可选:5s / 10s(默认)/ 30s
  • -
  • Great for isolating the exact cause-effect around a failure (e.g. what happened right before a 5xx alert) / 适合隔离某次失败前后的精确因果(如 5xx 告警前到底发生了什么)
  • -
-

点击任意事件即可「聚焦它前后 ±N 秒」,把噪音过滤掉,只留因果相关事件。

-

How It Works / 工作原理

-
    -
  • View-only merge — TimelineService.build() reads from InspectorService (network / logs / errors), RouteTrackerService, and AlertService, sorts them by time, and tags each with its TimelineEventKind. It does not copy or own any data. / 仅视图归并:TimelineService.build() 从各服务读取数据、按时间排序并打上来源标签,不复制、不持有数据。
  • -
  • Zero cost when closed — no timers, no listeners, no polling while the panel is not open; the merge runs on demand when you open the Timeline tab. / 面板关闭时零开销:未打开面板时不跑定时器、不监听、不轮询,仅在打开 Timeline 时按需归并。
  • -
  • contextAround(anchor, window) — given an anchor event and a Duration window, returns the slice of events whose timestamp falls within [anchor - window, anchor + window], oldest-first. / 给定锚点事件与窗口时长,返回落在 [锚点 - 窗口, 锚点 + 窗口] 内的事件,按时间升序。
  • -
- -
    -
  • Usage — General usage guide / 通用使用指南
  • -
  • FPS Viewer — Includes the main-thread blocking watchdog / 含主线程阻塞看门狗
  • -
  • Route Tracker — Route tracking details / 路由追踪详情
  • -

Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/Usage/index.html b/docs/Usage/index.html deleted file mode 100644 index 4fe5f50..0000000 --- a/docs/Usage/index.html +++ /dev/null @@ -1,210 +0,0 @@ -
📖 Usage

Usage / 使用指南

-

Integration Methods / 集成方式

- -
void main() {
-  ZeroInspectorKit.runAppWithInspector(const MyApp());
-}
-

This method:

-
    -
  • Auto-initializes inspector / 自动初始化检查器
  • -
  • Captures print() via Zone / 通过 Zone 捕获 print()
  • -
  • Displays floating button via Overlay / 通过 Overlay 显示悬浮按钮
  • -
  • Auto-injects route observer / 自动注入路由观察者
  • -
-

2. Two-Line Integration / 两行代码集成

-
void main() {
-  ZeroInspectorKit.init();
-  runApp(ZeroInspectorKit.wrapApp(const MyApp()));
-}
-

Inspector Panel / 检查器面板

-

The inspector panel contains 10 tabs (as of v1.12.0):

-

检查器面板包含 10 个标签页(v1.12.0 起):

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TabIconFeature
Network🌐HTTP request viewing + interceptor rules / 网络请求查看 + 拦截修改
Logs📝Log viewing with level filter / 日志查看
Errors🚨Aggregated & deduped crash viewing / 去重聚合的异常查看
Database💾Database and table inspection / 数据库查看
Memory📊Memory trend, Dart Heap, Native memory, leak detection / 内存趋势、Dart Heap、Native 内存、泄漏检测
FPS🎯Real-time FPS, jank rate, trend chart, plus main-thread blocking watchdog / 实时 FPS、卡顿率、趋势图,以及主线程阻塞看门狗
Routes🧭Route navigation tracking / 路由追踪
Timeline🧵Unified session timeline: network / logs / errors / routes / alerts merged into one stream, with ±N-second focus / 统一会话时间线:网络/日志/异常/路由/告警按时间归并,支持 ±N 秒聚焦
Widgets🔍Widget tree snapshot for the current route / 当前路由的 Widget 树快照
Alerts🔔Rule-based alerts with unread badge / 基于规则的告警与未读角标
-
-

The Memory and FPS monitors are off by default to avoid performance overhead. Toggle the switch at the top of each panel to start collecting data.

-

Memory 与 FPS 监控默认关闭以避免性能开销。在各自面板顶部打开开关才会开始采集数据。

-
-

One-Click Bug Report / 一键 Bug 报告

-

Tap the bug icon in the inspector panel header to generate and share a bug report in one tap — ideal for QA to attach environment context when filing issues.

-

点击检查器面板头部的虫子图标,即可一键生成并分享一份 Bug 报告——非常适合 QA 在提 issue 时附上环境上下文。

-

The shared text snapshot includes / 分享的文本快照包含:

-
    -
  • Device / 设备: real model (e.g. Pixel 8 Pro / iPhone (iPhone16,1)), OS & version, locale, Dart runtime, CPU cores.
  • -
  • Memory / 内存: current heap usage and whether Native memory is supported.
  • -
  • Recent logs / 最近日志: the latest captured log entries.
  • -
  • Recent network / 最近网络: the latest captured requests.
  • -
-

Sensitive headers are masked the same way as in the Network tab. No data leaves the device except through the share target you choose.

-

敏感请求头会与网络标签页一样被遮蔽。除你选择的分享目标外,数据不会离开设备。

-
-

Requires no extra setup — it works as soon as the inspector is running. / 无需额外配置——检查器运行后即可使用。

-
-

Floating Button / 悬浮按钮

-
    -
  • The floating button appears after 1 second delay / 悬浮按钮延迟 1 秒出现
  • -
  • Drag to move it along the screen edge / 拖动 可沿屏幕边缘移动
  • -
  • Tap (when fully visible) to open/close the inspector panel / 点击(完全可见时)打开/关闭检查器面板
  • -
  • Button auto-snaps to the nearest screen edge / 按钮自动吸附到最近的屏幕边缘
  • -
  • Breathing animation when idle / 空闲时有呼吸动画
  • -
-

Edge Docking (since v1.2.0) / 边缘吸附(v1.2.0 起)

-

When released near a screen edge, the button auto-docks and tucks into the edge, leaving only a 24px peek visible:

-

拖动松手后,按钮会自动吸附到最近边缘并”收入”边缘,仅露出 24px 小弧边:

- - - - - - - - - - - - - - - - - - - - - -
StateBehavior / 行为
Docked (tucked in)Only 24px peek visible; icon becomes a directional chevron (left dock → ➡, right dock → ⬅) hinting at tap-to-pull-out / 仅露出 24px;图标变为方向箭头提示可点击拉出
Tap docked peekSmoothly pulls out to fully visible (panel NOT opened, avoids accidental open) / 平滑拉出到完全可见(不打开面板,避免误触)
Tap fully visibleOpens the inspector panel / 打开检查器面板
-
-

This design avoids conflicts with system back gestures (Android/iOS edge swipe to go back) when pulling out from the docked state.

-

此设计避免了从吸附态拖出时与系统返回手势(Android/iOS 边缘右滑退出)的冲突。

-
-

Search / 搜索

-

The main viewers support fuzzy search:

-

各查看器均支持模糊搜索:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ViewerSearch Scope
NetworkURL, HTTP method / URL、请求方法
LogsMessage, tag / 消息、标签
ErrorsException type, message / 异常类型、消息
Database (global)Database name, table name / 数据库名、表名
Database (in-database)Table name, all column data / 表名、所有列数据
-

Manual Logging (Optional) / 手动记录日志(可选)

-

The inspector auto-captures print() output. You can also use manual log methods for precise level control:

-

检查器会自动捕获 print() 输出。也可以使用手动日志方法进行精确级别控制:

-

Quick shorthand (recommended) / 简化写法(推荐):

-
InspectorLog.v('Verbose log / 详细日志');
-InspectorLog.d('Debug log / 调试日志');
-InspectorLog.i('Info log / 信息日志');
-InspectorLog.w('Warning log / 警告日志');
-InspectorLog.e('Error log / 错误日志');
-

Full form / 完整写法:

-
InspectorLogInterceptor.instance.verbose('Verbose log / 详细日志');
-InspectorLogInterceptor.instance.debug('Debug log / 调试日志');
-InspectorLogInterceptor.instance.info('Info log / 信息日志');
-InspectorLogInterceptor.instance.warning('Warning log / 警告日志');
-InspectorLogInterceptor.instance.error('Error log / 错误日志');
-

Third-Party Log Integration / 第三方日志库集成

-

No configuration needed! The plugin automatically captures logs from third-party logging libraries (e.g., logger, flutter_logger) that use print() or debugPrint().

-

无需配置! 插件会自动捕获所有使用 print() 的第三方日志库的日志。

-

These logs are categorized as INFO level.

-

这些日志统一归类为 INFO 级别。

-

Bidirectional Sync (Optional) / 双向同步(可选)

-

To sync inspector-captured logs to your third-party logger:

-

将检查器捕获的日志同步到第三方日志库:

-
InspectorLogInterceptor.instance.onLogCaptured = (entry) {
-  yourLogger.log(entry.message);
-};
-

Feature Pages / 功能详情

-
    -
  • Network Inspector — Network request details + interceptor rules / 网络检查器详情 + 拦截修改
  • -
  • Log Viewer — Log viewing details / 日志查看器详情
  • -
  • Errors — Aggregated error viewing / 异常聚合查看
  • -
  • Database Viewer — Database inspection details / 数据库查看器详情
  • -
  • Route Tracker — Route tracking details / 路由追踪详情
  • -
  • Memory Viewer — Memory monitoring & leak detection / 内存监控与泄漏检测
  • -
  • FPS Viewer — FPS monitoring & jank detection / FPS 监控与卡顿检测
  • -
-

Session Persistence / 会话持久化

-

Logs, network requests, and aggregated errors are asynchronously flushed to a local SQLite ring buffer. On the next launch, logs and aggregated errors replay into their tabs; network requests stay archived on disk for later export. Data therefore survives app restarts even if the inspector panel was never opened. Tap the storage icon in the panel header to open the Persisted data manager: view row counts per category, export the full session archive, or clear the disk. See Configuration (PersistenceService section) for the API and tuning parameters.

-

日志、网络请求与聚合异常会被异步写入本地 SQLite 环形缓冲。下次启动时,日志与聚合异常会回放入各自标签页;网络请求保留在磁盘存档,供之后导出。因此即使从未打开过检查器面板,数据也能跨重启保留。点击面板头部的存储图标可打开 Persisted data 管理弹层:查看各类别行数、导出完整会话存档或清空磁盘。API 与调参详见 Configuration(PersistenceService 一节)。


Zero Inspector Kit · MPL-2.0
\ No newline at end of file diff --git a/docs/_next/static/__LlznvuRMzBBDamnz3ZC/_buildManifest.js b/docs/_next/static/__LlznvuRMzBBDamnz3ZC/_buildManifest.js deleted file mode 100644 index 1d4a8da..0000000 --- a/docs/_next/static/__LlznvuRMzBBDamnz3ZC/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST=function(e){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[e,"static/chunks/pages/index-a023a70af7653fd0.js"],"/Alerts":[e,"static/chunks/pages/Alerts-67b9a2e1364408bd.js"],"/Configuration":[e,"static/chunks/pages/Configuration-f7709e2930c815dd.js"],"/Custom-Database-Provider":[e,"static/chunks/pages/Custom-Database-Provider-bbe4c3db5859578c.js"],"/Database-Viewer":[e,"static/chunks/pages/Database-Viewer-bae8bb7c99f3f2a2.js"],"/Errors":[e,"static/chunks/pages/Errors-344e0971dee9c30f.js"],"/FAQ":[e,"static/chunks/pages/FAQ-732ea3f5a0dee1c1.js"],"/FPS-Viewer":[e,"static/chunks/pages/FPS-Viewer-81238a09d8e305a5.js"],"/Getting-Started":[e,"static/chunks/pages/Getting-Started-e063e8a36b4be785.js"],"/Installation":[e,"static/chunks/pages/Installation-fe3fd7f0e00f288d.js"],"/Log-Viewer":[e,"static/chunks/pages/Log-Viewer-1c1c1efb2e3a2223.js"],"/Memory-Viewer":[e,"static/chunks/pages/Memory-Viewer-07a16f5b6d8e3ac3.js"],"/Network-Inspector":[e,"static/chunks/pages/Network-Inspector-a75fcbccd976a923.js"],"/Route-Tracker":[e,"static/chunks/pages/Route-Tracker-8d1b310180aa3bf2.js"],"/Timeline":[e,"static/chunks/pages/Timeline-cbab8711b5c60f70.js"],"/Usage":[e,"static/chunks/pages/Usage-d8cd2ea5e7ca9dc0.js"],"/_error":["static/chunks/pages/_error-7a92967bea80186d.js"],"/_meta":["static/chunks/pages/_meta-b47e7a01bb6b7929.js"],sortedPages:["/","/Alerts","/Configuration","/Custom-Database-Provider","/Database-Viewer","/Errors","/FAQ","/FPS-Viewer","/Getting-Started","/Installation","/Log-Viewer","/Memory-Viewer","/Network-Inspector","/Route-Tracker","/Timeline","/Usage","/_app","/_error","/_meta"]}}("static/chunks/812-3fcedf6f3c3b1908.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/docs/_next/static/__LlznvuRMzBBDamnz3ZC/_ssgManifest.js b/docs/_next/static/__LlznvuRMzBBDamnz3ZC/_ssgManifest.js deleted file mode 100644 index ffdf6d2..0000000 --- a/docs/_next/static/__LlznvuRMzBBDamnz3ZC/_ssgManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__SSG_MANIFEST=new Set(["\u002F_meta"]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() \ No newline at end of file diff --git a/docs/_next/static/chunks/812-3fcedf6f3c3b1908.js b/docs/_next/static/chunks/812-3fcedf6f3c3b1908.js deleted file mode 100644 index f6d4191..0000000 --- a/docs/_next/static/chunks/812-3fcedf6f3c3b1908.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[812],{4080:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return w}});let i=r(8754),o=r(1757),n=r(5893),s=o._(r(7294)),l=i._(r(3935)),a=i._(r(3867)),u=r(5283),d=r(6594),c=r(3945);r(3179);let f=r(1928),g=i._(r(3872)),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/zero_inspector_kit/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function h(e,t,r,i,o,n,s){let l=null==e?void 0:e.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&o(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let i=!1,o=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>i,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{i=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==i?void 0:i.current)&&i.current(e)}}))}function m(e){return s.use?{fetchPriority:e}:{fetchpriority:e}}let v=(0,s.forwardRef)((e,t)=>{let{src:r,srcSet:i,sizes:o,height:l,width:a,decoding:u,className:d,style:c,fetchPriority:f,placeholder:g,loading:p,unoptimized:v,fill:b,onLoadRef:w,onLoadingCompleteRef:y,setBlurComplete:x,setShowAltText:j,sizesInput:S,onLoad:_,onError:C,...z}=e;return(0,n.jsx)("img",{...z,...m(f),loading:p,width:a,height:l,decoding:u,"data-nimg":b?"fill":"1",className:d,style:c,sizes:o,srcSet:i,src:r,ref:(0,s.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(C&&(e.src=e.src),e.complete&&h(e,g,w,y,x,v,S))},[r,g,w,y,x,C,v,S,t]),onLoad:e=>{h(e.currentTarget,g,w,y,x,v,S)},onError:e=>{j(!0),"empty"!==g&&x(!0),C&&C(e)}})});function b(e){let{isAppRouter:t,imgAttributes:r}=e,i={as:"image",imageSrcSet:r.srcSet,imageSizes:r.sizes,crossOrigin:r.crossOrigin,referrerPolicy:r.referrerPolicy,...m(r.fetchPriority)};return t&&l.default.preload?(l.default.preload(r.src,i),null):(0,n.jsx)(a.default,{children:(0,n.jsx)("link",{rel:"preload",href:r.srcSet?void 0:r.src,...i},"__nimg-"+r.src+r.srcSet+r.sizes)})}let w=(0,s.forwardRef)((e,t)=>{let r=(0,s.useContext)(f.RouterContext),i=(0,s.useContext)(c.ImageConfigContext),o=(0,s.useMemo)(()=>{var e;let t=p||i||d.imageConfigDefault,r=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),o=t.deviceSizes.sort((e,t)=>e-t),n=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:r,deviceSizes:o,qualities:n}},[i]),{onLoad:l,onLoadingComplete:a}=e,h=(0,s.useRef)(l);(0,s.useEffect)(()=>{h.current=l},[l]);let m=(0,s.useRef)(a);(0,s.useEffect)(()=>{m.current=a},[a]);let[w,y]=(0,s.useState)(!1),[x,j]=(0,s.useState)(!1),{props:S,meta:_}=(0,u.getImgProps)(e,{defaultLoader:g.default,imgConf:o,blurComplete:w,showAltText:x});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v,{...S,unoptimized:_.unoptimized,placeholder:_.placeholder,fill:_.fill,onLoadRef:h,onLoadingCompleteRef:m,setBlurComplete:y,setShowAltText:j,sizesInput:e.sizes,ref:t}),_.priority?(0,n.jsx)(b,{isAppRouter:!r,imgAttributes:S}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},5283:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return l}}),r(3179);let i=r(6630),o=r(6594);function n(e){return void 0!==e.default}function s(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function l(e,t){var r,l;let a,u,d,{src:c,sizes:f,unoptimized:g=!1,priority:p=!1,loading:h,className:m,quality:v,width:b,height:w,fill:y=!1,style:x,overrideSrc:j,onLoad:S,onLoadingComplete:_,placeholder:C="empty",blurDataURL:z,fetchPriority:P,decoding:E="async",layout:M,objectFit:O,objectPosition:R,lazyBoundary:I,lazyRoot:k,...N}=e,{imgConf:A,showAltText:D,blurComplete:G,defaultLoader:B}=t,F=A||o.imageConfigDefault;if("allSizes"in F)a=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t),i=null==(r=F.qualities)?void 0:r.sort((e,t)=>e-t);a={...F,allSizes:e,deviceSizes:t,qualities:i}}if(void 0===B)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let L=N.loader||B;delete N.loader,delete N.srcSet;let W="__next_img_default"in L;if(W){if("custom"===a.loader)throw Error('Image with src "'+c+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=L;L=t=>{let{config:r,...i}=t;return e(i)}}if(M){"fill"===M&&(y=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[M];e&&(x={...x,...e});let t={responsive:"100vw",fill:"100vw"}[M];t&&!f&&(f=t)}let q="",T=s(b),U=s(w);if("object"==typeof(l=c)&&(n(l)||void 0!==l.src)){let e=n(c)?c.default:c;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(u=e.blurWidth,d=e.blurHeight,z=z||e.blurDataURL,q=e.src,!y){if(T||U){if(T&&!U){let t=T/e.width;U=Math.round(e.height*t)}else if(!T&&U){let t=U/e.height;T=Math.round(e.width*t)}}else T=e.width,U=e.height}}let V=!p&&("lazy"===h||void 0===h);(!(c="string"==typeof c?c:q)||c.startsWith("data:")||c.startsWith("blob:"))&&(g=!0,V=!1),a.unoptimized&&(g=!0),W&&c.endsWith(".svg")&&!a.dangerouslyAllowSVG&&(g=!0),p&&(P="high");let J=s(v),Y=Object.assign(y?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:O,objectPosition:R}:{},D?{}:{color:"transparent"},x),$=G||"empty"===C?null:"blur"===C?'url("data:image/svg+xml;charset=utf-8,'+(0,i.getImageBlurSvg)({widthInt:T,heightInt:U,blurWidth:u,blurHeight:d,blurDataURL:z||"",objectFit:Y.objectFit})+'")':'url("'+C+'")',H=$?{backgroundSize:Y.objectFit||"cover",backgroundPosition:Y.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:$}:{},K=function(e){let{config:t,src:r,unoptimized:i,width:o,quality:n,sizes:s,loader:l}=e;if(i)return{src:r,srcSet:void 0,sizes:void 0};let{widths:a,kind:u}=function(e,t,r){let{deviceSizes:i,allSizes:o}=e;if(r){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let i;i=e.exec(r);i)t.push(parseInt(i[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=i[0]*e),kind:"w"}}return{widths:o,kind:"w"}}return"number"!=typeof t?{widths:i,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))],kind:"x"}}(t,o,s),d=a.length-1;return{sizes:s||"w"!==u?s:"100vw",srcSet:a.map((e,i)=>l({config:t,src:r,quality:n,width:e})+" "+("w"===u?e:i+1)+u).join(", "),src:l({config:t,src:r,quality:n,width:a[d]})}}({config:a,src:c,unoptimized:g,width:T,quality:J,sizes:f,loader:L});return{props:{...N,loading:V?"lazy":h,fetchPriority:P,width:T,height:U,decoding:E,className:m,style:{...Y,...H},sizes:K.sizes,srcSet:K.srcSet,src:j||K.src},meta:{unoptimized:g,priority:p,placeholder:C,fill:y}}}},6630:function(e,t){"use strict";function r(e){let{widthInt:t,heightInt:r,blurWidth:i,blurHeight:o,blurDataURL:n,objectFit:s}=e,l=i?40*i:t,a=o?40*o:r,u=l&&a?"viewBox='0 0 "+l+" "+a+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+u+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(u?"none":"contain"===s?"xMidYMid":"cover"===s?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+n+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},6210:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return a},getImageProps:function(){return l}});let i=r(8754),o=r(5283),n=r(4080),s=i._(r(3872));function l(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:s.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/zero_inspector_kit/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let a=n.Image},3872:function(e,t){"use strict";function r(e){var t;let{config:r,src:i,width:o,quality:n}=e,s=n||(null==(t=r.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75)(0,s.createElement)("object"==typeof e.src?n():"img",e)},a=e=>(0,i.a)({...l,...e})},7812:function(e,t,r){"use strict";r.d(t,{c:function(){return u}});var i=r(5893),o=r(3665),n=r(8644);let s=(0,r(7294).createContext)({}),l=s.Provider;s.displayName="SSG";var a=r(8925);function u(e,t,r,i){let n=globalThis[o.ud];return n.route=t,n.pageMap=r.pageMap,n.context[t]={Content:e,pageOpts:r,useTOC:i},d}function d({__nextra_pageMap:e=[],__nextra_dynamic_opts:t,...r}){let s=globalThis[o.ud],{Layout:a,themeConfig:u}=s,{route:d,locale:f}=(0,n.t)(),g=s.context[d];if(!g)throw Error(`No content found for the "${d}" route. Please report it as a bug.`);let{pageOpts:p,useTOC:h,Content:m}=g;if(d.startsWith("/["))p.pageMap=e;else for(let{route:t,children:r}of e){let e=t.split("/").slice(f?2:1);(function e(t,[r,...i]){for(let o of t)if("children"in o&&r===o.name)return i.length?e(o.children,i):o})(p.pageMap,e).children=r}if(t){let{title:e,frontMatter:r}=t;p={...p,title:e,frontMatter:r}}return(0,i.jsx)(a,{themeConfig:u,pageOpts:p,pageProps:r,children:(0,i.jsx)(l,{value:r,children:(0,i.jsx)(c,{useTOC:h,children:(0,i.jsx)(m,{...r})})})})}function c({children:e,useTOC:t}){let{wrapper:r}=(0,a.a)();return(0,i.jsx)(f,{useTOC:t,wrapper:r,children:e})}function f({children:e,useTOC:t,wrapper:r,...o}){let n=t(o);return r?(0,i.jsx)(r,{toc:n,children:e}):e}}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/921.19ce7ecee48bd1bc.js b/docs/_next/static/chunks/921.19ce7ecee48bd1bc.js deleted file mode 100644 index 773f1e5..0000000 --- a/docs/_next/static/chunks/921.19ce7ecee48bd1bc.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[921],{4921:function(t,e,i){"use strict";var n;function s(t){return void 0===t||t}function r(t){let e=Array(t);for(let i=0;i=n))));e++);if(i)return r?S(o,n,0):void(e[e.length]=o)}return!i&&o}function S(t,e,i){return t=1===t.length?t[0]:[].concat.apply([],t),i||t.length>e?t.slice(i,i+e):t}function z(t,e,i,n){return t=i?(t=t[(n=n&&e>i)?e:i])&&t[n?i:e]:t[e]}function J(t,e,i,n,s){let r=0;if(t.constructor===Array){if(s)-1!==(e=t.indexOf(e))?1=this.B&&(u||!a[p])){var r=D(g,n,d),l="";switch(this.G){case"full":if(2r;o--)if(o-r>=this.B){var f=D(g,n,d,s,r);_(this,a,l=p.substring(r,o),f,t,i)}break}case"reverse":if(1=this.B&&_(this,a,l,D(g,n,d,s,o),t,i);l=""}case"forward":if(1=this.B&&_(this,a,l,r,t,i);break}default:if(this.C&&(r=Math.min(r/this.C(e,p,d)|0,g-1)),_(this,a,p,r,t,i),u&&1=this.B&&!s[p]){s[p]=1;let e=this.l&&p>r;_(this,c,e?r:p,D(l+(n/2>l?0:1),n,d,o-1,f-1),t,i,e?p:r)}}}}}this.m||(this.register[t]=1)}}return this},n.search=function(t,e,i){let n,s,r;i||(!e&&f(t)?t=(i=t).query:f(e)&&(i=e));let o=[],c,a,u=0;if(i){t=i.query||t,e=i.limit,u=i.offset||0;var g=i.context;a=i.suggest}if(t&&1<(c=(t=this.encode(""+t)).length)){i=h();var d=[];for(let e=0,n=0,s;e=this.B&&!i[s]){if(!this.s&&!a&&!this.map[s])return o;d[n++]=s,i[s]=1}c=(t=d).length}if(!c)return o;for(e||(e=100),g=this.depth&&1{r=t})),s||(s=0)){case 0:if(l="reg",this.m)for(let t in o=h(),this.register)o[t]=1;else o=this.register;break;case 1:l="cfg",o={doc:0,opt:this.s?1:0};break;case 2:l="map",o=this.map;break;case 3:l="ctx",o=this.h;break;default:void 0===i&&r&&r();return}return j(t,e||this,i,l,n,s,o,r),f},n.import=function(t,e){if(e)switch(o(e)&&(e=JSON.parse(e)),t){case"cfg":this.s=!!e.opt;break;case"reg":this.m=!1,this.register=e;break;case"map":this.map=e;break;case"ctx":this.h=e}},v(B.prototype);let P=0;function q(t){var e;if(!(this instanceof q))return new q(t);t?c(e=t.encode)&&(t.encode=e.toString()):t={},(e=(self||window)._factory)&&(e=e.toString());let n="undefined"==typeof window&&self.exports,s=this;this.o=function(t,e,n){let s;try{s=e?new(i(5789)).Worker("//node/node.js"):t?new Worker(URL.createObjectURL(new Blob(["onmessage="+M.toString()],{type:"text/javascript"}))):new Worker(o(n)?n:"worker/worker.js",{type:"module"})}catch(t){}return s}(e,n,t.worker),this.h=h(),this.o&&(n?this.o.on("message",function(t){s.h[t.id](t.msg),delete s.h[t.id]}):this.o.onmessage=function(t){t=t.data,s.h[t.id](t.msg),delete s.h[t.id]},this.o.postMessage({task:"init",factory:e,options:t}))}function I(t){q.prototype[t]=q.prototype[t+"Async"]=function(){let e;let i=this,n=[].slice.call(arguments);var s=n[n.length-1];return c(s)&&(e=s,n.splice(n.length-1,1)),s=new Promise(function(e){setTimeout(function(){i.h[++P]=e,i.o.postMessage({task:t,id:P,args:n})})}),e?(s.then(e),this):s}}function N(t){if(!(this instanceof N))return new N(t);var e,i=t.document||t.doc||t;this.K=[],this.h=[],this.A=[],this.register=h(),this.key=(e=i.key||i.id)&&L(e,this.A)||"id",this.m=s(t.fastupdate),this.C=(e=i.store)&&!0!==e&&[],this.store=e&&h(),this.I=(e=i.tag)&&L(e,this.A),this.l=e&&h(),this.cache=(e=t.cache)&&new C(e),t.cache=!1,this.o=t.worker,this.async=!1,e=h();let n=i.index||i.field||i;o(n)&&(n=[n]);for(let i=0,s,r;ie||i)&&(s=s.slice(i,i+e)),n&&(s=W.call(this,s)),{tag:t,result:s}}function W(t){let e=Array(t.length);for(let i=0,n;i{r=t})),s||(s=0),n||(n=0),n