Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计通过

flutter-improving-accessibilityFlutter improving 无障碍

Agent Skill

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

总安装

209,664

周安装

8,444

GitHub Stars

1,316

下载量

67,872
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

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

简介

配置 Flutter 应用程序的辅助技术,包括屏幕阅读器和键盘导航。

  • 涵盖 UI 设计基础知识:字体缩放、颜色对比度(普通文本为 4.5:1,大文本为 3:1)和 48x48 像素最小点击目标
  • 使用 Semantics 提供语义注释模式, 合并语义
  • 、和排除语义
  • 用于向辅助工具公开小部件树结构的小部件
  • 包括有关启用语义层(默认情况下禁用以提高性能)和将自定义组件映射到 ARIA 角色的特定于 Web 的指南
  • 提供合规性检查表和验证反馈循环,用于使用 VoiceOver 和 TalkBack 等屏幕阅读器进行测试

SKILL.md

Implementing Flutter Accessibility

Contents

UI Design and Styling

Design layouts to accommodate dynamic scaling and high visibility. Flutter automatically calculates font sizes based on OS-level accessibility settings.

  • Font Scaling: Ensure layouts provide sufficient room to render all contents when font sizes are increased to their maximum OS settings. Avoid hardcoding fixed heights on text containers.
  • Color Contrast: Maintain a contrast ratio of at least 4.5:1 for small text and 3.0:1 for large text (18pt+ regular or 14pt+ bold) to meet W3C standards.
  • Tap Targets: Enforce a minimum tap target size of 48x48 logical pixels to accommodate users with limited dexterity.

Accessibility Widgets

Utilize Flutter's catalog of accessibility widgets to manipulate the semantics tree exposed to assistive technologies (like TalkBack or VoiceOver).

  • Semantics: Use this to annotate the widget tree with a description of the meaning of the widgets. Assign specific roles using the SemanticsRole enum (e.g., button, link, heading) when building custom components.
  • MergeSemantics: Wrap composite widgets to merge the semantics of all descendants into a single selectable node for screen readers.
  • ExcludeSemantics: Use this to drop the semantics of all descendants, hiding redundant or purely decorative sub-widgets from accessibility tools.

Web Accessibility

Flutter web renders UI on a single canvas, requiring a specialized DOM layer to expose structure to browsers.

  • Enable Semantics: Web accessibility is disabled by default for performance. Users can enable it via an invisible button (aria-label="Enable accessibility").
  • Programmatic Enablement: If building a web-first application requiring default accessibility, force the semantics tree generation at startup.
  • Semantic Roles: Rely on standard widgets (TabBar, MenuAnchor, Table) for automatic ARIA role mapping. For custom components, explicitly assign SemanticsRole values to ensure screen readers interpret the elements correctly.

Adaptive and Responsive Design

Differentiate between adaptive and responsive paradigms to build universal applications.

  • Responsive Design: Adjust the placement, sizing, and reflowing of design elements to fit the available screen space.
  • Adaptive Design: Select appropriate layouts (e.g., bottom navigation vs. side panel) and input mechanisms (e.g., touch vs. mouse/keyboard) to make the UI usable within the current device context. Design to the strengths of each form factor.

Workflows

Task Progress: Accessibility Implementation

Copy this checklist to track accessibility compliance during UI development:

  • Verify all interactive elements have a minimum tap target of 48x48 pixels.
  • Test layout with maximum OS font size settings to ensure no text clipping or overflow occurs.
  • Validate color contrast ratios (4.5:1 for normal text, 3.0:1 for large text).
  • Wrap custom interactive widgets in Semantics and assign the appropriate SemanticsRole.
  • Group complex composite widgets using MergeSemantics to prevent screen reader fatigue.
  • Hide decorative elements from screen readers using ExcludeSemantics.
  • If targeting web, verify ARIA roles are correctly mapped and consider programmatic enablement of the semantics tree.

Feedback Loop: Accessibility Validation

Run this loop when finalizing a view or component:

  1. Run validator: Execute accessibility tests or use OS-level screen readers (VoiceOver/TalkBack) to navigate the view.
  2. Review errors: Identify unannounced interactive elements, trapped focus, or clipped text.
  3. Fix: Apply Semantics, adjust constraints, or modify colors. Repeat until the screen reader provides a clear, logical traversal of the UI.

Examples

Programmatic Web Accessibility Enablement

If targeting web and requiring accessibility by default, initialize the semantics binding before running the app.

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

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

Custom Component Semantics

If building a custom widget that acts as a list item, explicitly define its semantic role so assistive technologies and web ARIA mappings interpret it correctly.

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

class CustomListItem extends StatelessWidget {
  final String text;

  const CustomListItem({super.key, required this.text});

  @override
  Widget build(BuildContext context) {
    return Semantics(
      role: SemanticsRole.listItem,
      label: text,
      child: Padding(
        padding: const EdgeInsets.all(12.0), // Ensures > 48px tap target if interactive
        child: Text(
          text,
          style: const TextStyle(fontSize: 16), // Ensure contrast ratio > 4.5:1
        ),
      ),
    );
  }
}

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.7%
按下载量换算24,909

Claude

27.46%
按下载量换算18,638

Cursor

19.5%
按下载量换算13,235

Gemini CLI

9.99%
按下载量换算6,780

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills