flutter-add-widget-test
Create Reliable Flutter Widget Tests
Flutter UI changes can fail when rendering and user interactions are not tested. This skill provides a clear workflow for building focused WidgetTester tests and validating state changes.
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "flutter-add-widget-test" from https://skillstore.io/skills/flutter-flutter-add-widget-test.md and its manifest at https://skillstore.io/api/skills/flutter-flutter-add-widget-test/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“flutter-add-widget-test”。 Test a counter button that increments from zero.
预期结果:
- A WidgetTester test structure with a MaterialApp wrapper.
- An initial assertion for zero, a tap action, a pump call, and an assertion for one.
正在使用“flutter-add-widget-test”。 Test adding and dismissing a todo item.
预期结果:
- A test sequence for entering todo text and tapping the add button.
- Assertions confirming the item appears, then disappears after a dismissal gesture.
安全审计
安全All 32 static findings are false positives caused by Markdown inline-code delimiters and ordinary Dart identifiers. The skill contains Flutter widget-test guidance and a local example only; no executable shell, Ruby, Python, network, certificate, or reconnaissance behavior was found.
风险因素
⚙️ 外部命令 (28)
📁 文件系统访问 (1)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/flutter-flutter-add-widget-test/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/flutter-flutter-add-widget-test?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/flutter-flutter-add-widget-test?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/flutter-flutter-add-widget-test/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/flutter-flutter-add-widget-test.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
flutter. (2026). flutter-add-widget-test security audit report (audit version 1) [Author version unspecified]. Skillstore. https://skillstore.io/skills/flutter-flutter-add-widget-test/audits/1BibTeX 引用
@techreport{flutter-flutter-flutter-add-widget-test-2026,
author = {flutter},
title = {flutter-add-widget-test security audit report (audit version 1)},
institution = {Skillstore},
year = {2026},
number = {1},
url = {https://skillstore.io/skills/flutter-flutter-add-widget-test/audits/1},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "flutter-add-widget-test security audit report (audit version 1)"
version: "unspecified"
type: report
authors:
- name: "flutter"
date-released: "2026-08-30"
url: "https://skillstore.io/skills/flutter-flutter-add-widget-test/audits/1"
identifiers:
- type: other
value: "skillstore:flutter-flutter-add-widget-test:audit:1"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 中你能构建什么
Test a new form interaction
Create a widget test that enters text, taps a control, and checks the updated interface.
Verify a reusable component
Confirm that a shared widget renders expected content and responds to a defined user action.
Review a regression test
Use the checklist to verify that a test covers setup, action, frame updates, and assertions.
试试这些提示
Create a Flutter widget test for MyWidget. Verify that it renders inside a MaterialApp.
Write a widget test for my Flutter screen. Tap the Save button, pump the widget tree, and verify the success message.
Create a widget test that enters text into my search field and verifies the filtered list item appears.
Create a Flutter widget test for a dismissible list item. Drag it, wait for the animation, and verify it is removed.
最佳实践
- Assert the initial UI state before triggering an interaction.
- Pump the widget tree after every action that changes state.
- Use stable keys when text or widget types are not unique.
避免
- Do not assert state changes before pumping a frame.
- Do not use pumpAndSettle for every test when a single pump is sufficient.
- Do not depend on ambiguous finders when multiple widgets match.