搜索分类、插件与代码仓

inspector 封面
插件详情v4.0.0

inspector

一个用于检查小部件的 Flutter 包。适用于快速调试或质量保证测试。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
51.2万
喜欢数
87
Pub 分数
150

安装插件

flutter pub add inspector

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

inspectors 包是一个专为 Flutter 设计的工具,用于实时检查 widget,使开发者和测试人员能够快速调试 UI 问题或执行质量保证检查。它提供了一个交互式覆盖层,可在设备或模拟器上直接检查 widget 树、其属性和布局行为。非常适合在开发过程中快速获得反馈,无需复杂设置即可增强对 UI 结构的可见性。该包支持所有主要平台,使其在各种环境中都具有高度灵活性。

适合场景

  • 快速UI调试
  • QA测试
  • 实时小部件分析
  • 开发反馈循环
  • 跨平台 UI 验证

主要特点

  • 交互式小部件叠加层
  • 实时属性检查
  • 支持所有 Flutter 平台
  • 所需设置最少
  • 面向非开发人员的直观用户界面

适合对象

  • Developers
  • QA 测试人员
  • UI 设计师
  • 快速原型团队

使用建议

  • 不适用于生产构建
  • 可能影响大型应用的性能
  • 叠加层可能在测试期间干扰用户界面
  • 需要手动激活
  • 仅限视觉检查

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

inspector

Pub Version GitHub Workflow Status Coverage Status GitHub Repo stars

A Flutter package for inspecting widgets. Also comes with an eyedropper and a magnifying glass. Useful for debugging widgets and for QA testing.

Supports keyboard shortcuts if you're using a physical keyboard.

Check out the example web app!

Inspired by inspx.

WIP

Warning, the development of this package is still in progress and some things may break your app.

Features

  • [x] Color picker
  • [x] Size inspection
  • [x] Padding inspection
  • [x] Keyboard shortcuts
  • [x] Zooming
  • [ ] BorderRadius inspection
  • [x] TextStyle inspection

Installing

Add the dependency:

$ flutter pub add inspector

Import the package:

import 'package:inspector/inspector.dart';

Wrap MaterialApp.builder or WidgetsApp.builder with Inspector:

MaterialApp(
  home: ExampleApp(),
  builder: (context, child) => Inspector(child: child!), // Wrap [child] with [Inspector]
),

Optionally, you can pass isEnabled to the Inspector to disable it. By default, the inspector is disabled when kReleaseMode == true.

Usage

If the inspector is enabled, then a panel appears on the right side of the screen, with buttons to toggle size inspection and the color picker.

It's quite straightforward to use, just tap on the widget that you want to measure or tap on the pixel to get its color.

You can also use keyboard shortcuts - Shift will toggle the color picker, Z will toggle the zoom, and Alt or Cmd will toggle the widget inspector.

Examples

Contact me

Feel free to contact me at:

E-mail: kk.erzhan@gmail.com

所属分类

源码仓库

使用此插件的项目