Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

flutter-accessibility-auditFlutter 无障碍审核

Agent Skill

用于辅助无障碍访问检查、页面可用性审计和前端可访问性改进。它适合让 Agent 检查语义标签、键盘操作、颜色对比、ARIA 属性和自动化检测结果。使用时需要结合真实页面和浏览器验证,不应只依赖静态文本判断;涉及修复建议时,应兼顾设计系统、组件复用和 WCAG 等通用无障碍规范。

总安装

36,466

周安装

1,528

GitHub Stars

1,264

下载量

11,779
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:flutter-accessibility-audit(Flutter 无障碍审核)
来源仓库:https://github.com/flutter/skills
仓库路径:skills/flutter-accessibility-audit
安装命令:
npx skills add https://github.com/flutter/skills --skill flutter-accessibility-audit
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/flutter/skills --skill flutter-accessibility-audit

简介

用于辅助无障碍访问检查、页面可用性审计和前端可访问性改进,适合审查语义标签与键盘操作。

  • 支持检查颜色对比、ARIA 属性和自动化检测结果,需结合真实页面验证。
  • 使用时不应仅依赖静态文本判断,应兼顾设计系统与 WCAG 规范。
  • 安装方式:github,命令:npx skills add https://github.com/flutter/skills --skill flutter-accessibility-audit。
  • 建议确认项目测试框架与运行命令,避免为了通过检测而破坏逻辑。

SKILL.md

Implementing Flutter Accessibility

Contents

Managing Semantics

Rely on Flutter's standard widgets (e.g., TabBar, MenuAnchor) for automatic semantic role assignment whenever possible. When building custom components or overriding default behaviors, explicitly define the UI element's purpose using the Semantics widget.

  • Wrap custom UI components in a Semantics widget.
  • Assign the appropriate SemanticsRole enum value to the role property to define the element's purpose (e.g., button, list, heading).
  • If building for Flutter Web, note that Flutter translates these roles into corresponding ARIA roles in the HTML DOM.
  • Enable web accessibility explicitly. It is disabled by default for performance. Either instruct users to press the invisible aria-label="Enable accessibility" button, or force it programmatically in your main() function.

Auditing Accessibility

Implement the following workflows to verify that your application meets accessibility standards.

Task Progress: Platform-Specific Scanning

Copy this checklist to track your manual auditing progress across target platforms:

  • If testing on Android:

1. Install the Accessibility Scanner from Google Play. 2. Enable it via Settings > Accessibility > Accessibility Scanner > On. 3. Tap the Accessibility Scanner checkmark icon over your running app to initiate the scan.

  • If testing on iOS:

1. Open the ios folder in Xcode and run the app on a Simulator. 2. Navigate to Xcode > Open Developer Tools > Accessibility Inspector. 3. Select Inspection > Enable Point to Inspect and click UI elements to verify attributes. 4. Select Audit > Run Audit to generate an issue report.

  • If testing on Web:

1. Open Chrome DevTools. 2. Inspect the HTML tree under the semantics host node. 3. Navigate to the Elements tab and open the Accessibility sub-tab to inspect exported ARIA data. 4. Visualize semantic nodes by running the app with: flutter run -d chrome --profile --dart-define=FLUTTER_WEB_DEBUG_SHOW_SEMANTICS=true.

Task Progress: Automated Testing

Integrate Flutter's Accessibility Guideline API into your widget tests to catch contrast, target size, and labeling issues automatically.

  • Create a dedicated test file (e.g., test/a11y_test.dart).
  • Initialize the semantics handle using tester.ensureSemantics().
  • Assert against androidTapTargetGuideline (48x48px minimum).
  • Assert against iOSTapTargetGuideline (44x44px minimum).
  • Assert against labeledTapTargetGuideline.
  • Assert against textContrastGuideline (3:1 minimum for large text).
  • Dispose of the semantics handle at the end of the test.

Debugging the Semantics Tree

When semantic nodes are incorrectly placed or missing, execute the following feedback loop to identify and resolve the discrepancies.

  1. Run validator: Trigger a dump of the Semantics tree to the console.

- Enable accessibility via a system tool or SemanticsDebugger. - Invoke debugDumpSemanticsTree() (e.g., bind it to a GestureDetector's onTap callback for easy triggering during debugging).

  1. Review errors: Analyze the console output to locate missing labels, incorrect roles, or improperly nested semantic nodes.
  2. Fix: Wrap the offending widgets in Semantics or MergeSemantics widgets, apply the correct SemanticsRole, and repeat step 1 until the tree accurately reflects the visual UI.

Examples

Programmatically Enabling Web Accessibility

Force the Semantics tree to build immediately on Flutter Web.

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';

void main() {
  runApp(const MyApp());
  if (kIsWeb) {
    SemanticsBinding.instance.ensureSemantics();
  }
}

Explicitly Defining Semantic Roles

Assign explicit list and list-item roles to a custom layout.

import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';

class MyCustomListWidget extends StatelessWidget {
  const MyCustomListWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Semantics(
      role: SemanticsRole.list,
      explicitChildNodes: true,
      child: Column(
        children: <Widget>[
          Semantics(
            role: SemanticsRole.listItem,
            child: const Padding(
              padding: EdgeInsets.all(8.0),
              child: Text('Content of the first custom list item.'),
            ),
          ),
          Semantics(
            role: SemanticsRole.listItem,
            child: const Padding(
              padding: EdgeInsets.all(8.0),
              child: Text('Content of the second custom list item.'),
            ),
          ),
        ],
      ),
    );
  }
}

Automated Accessibility Testing

Implement the Accessibility Guideline API in a widget test.

import 'package:flutter_test/flutter_test.dart';
import 'package:your_accessible_app/main.dart';

void main() {
  testWidgets('Follows a11y guidelines', (tester) async {
    final SemanticsHandle handle = tester.ensureSemantics();
    await tester.pumpWidget(const AccessibleApp());

    // Check tap target sizes
    await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
    await expectLater(tester, meetsGuideline(iOSTapTargetGuideline));

    // Check labels and contrast
    await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
    await expectLater(tester, meetsGuideline(textContrastGuideline));

    handle.dispose();
  });
}

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.18%
按下载量换算4,379

Claude

29.87%
按下载量换算3,518

Cursor

16.07%
按下载量换算1,893

Gemini CLI

9.5%
按下载量换算1,119

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills