{
    "url": "https://delaparra-services.nl/skills/flutter-accessibility",
    "locale": "en",
    "title": "Run Lighthouse CI from command line | DeLaParra Services",
    "description": "Use when implementing or auditing accessibility on a Flutter screen — the Semantics widget, screen-reader labels (TalkBack/VoiceOver), colour contrast, minimum tap-target size, system font scaling, or semantics in a web build. Also triggers on \"make this accessible\", \"a11y\", or a request for an accessibility review.",
    "alternates": {
        "en": "https://delaparra-services.nl/skills/flutter-accessibility",
        "nl": "https://delaparra-services.nl/nl/skills/flutter-accessibility"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/skills/flutter-accessibility.csv",
        "md": "https://delaparra-services.nl/skills/flutter-accessibility.md",
        "json": "https://delaparra-services.nl/skills/flutter-accessibility.json",
        "zip": "https://delaparra-services.nl/skills/flutter-accessibility.zip",
        "pdf": "https://delaparra-services.nl/skills/flutter-accessibility.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/skills/flutter-accessibility.csv",
            "encodingFormat": "text/csv",
            "name": "flutter-accessibility.csv"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-accessibility.json",
            "encodingFormat": "application/json",
            "name": "flutter-accessibility.json"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-accessibility.md",
            "encodingFormat": "text/markdown",
            "name": "flutter-accessibility.md"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-accessibility.pdf",
            "encodingFormat": "application/pdf",
            "name": "flutter-accessibility.pdf"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-accessibility.zip",
            "encodingFormat": "application/zip",
            "name": "flutter-accessibility.zip"
        },
        {
            "url": "https://delaparra-services.nl/skills/flutter-accessibility/download",
            "encodingFormat": "application/zip",
            "name": "flutter-accessibility-files.zip"
        }
    ],
    "markdown": "# Run Lighthouse CI from command line\n\n \n\nUse when implementing or auditing accessibility on a Flutter screen — the Semantics widget, screen-reader labels (TalkBack/VoiceOver), colour contrast, minimum tap-target size, system font scaling, or semantics in a web build. Also triggers on \"make this accessible\", \"a11y\", or a request for an accessibility review.\n\n \n\n**Licence** MIT\n\n \n\n**Source** gabuldev/flutter-skills\n\n [Download zip](<https://delaparra-services.nl/skills/flutter-accessibility/download>)   \n\nYou are implementing or auditing accessibility (a11y) for a Flutter app.\n\n \n\n## Context\n\n \n\nAccessibility pressure differs by surface, and it changes what you prioritise:\n\n \n\n- **Customer-facing web** — the highest bar. Screen-reader semantics are off by default on Flutter web (see section 5), the audience is unknown, and in many jurisdictions this is a legal requirement, not a nicety. \n- **Internal/admin web** — keyboard navigation and contrast matter most; staff use these all day. \n- **Mobile** — platform screen readers (TalkBack/VoiceOver) mostly work if you give widgets labels and keep tap targets large enough.\n\n \n\nChoose based on the skill argument, if one was given, or on the screen/task at hand:\n\n \n\n- ` audit ` — Review existing code for a11y violations and produce a report with fixes \n- ` implement ` — Add accessibility annotations and fixes to existing widgets \n- ` web-setup ` — Enable Flutter web semantics and configure for screen readers \n- If no mode specified, default to ` implement `\n\n  \n\n## 1. Semantic Annotations\n\n \n\nWrap custom widgets with ` Semantics ` to expose meaning to assistive technology:\n\n \n\n```\n// Label interactive elements\nSemantics(\n  label: 'Adicionar ao pedido',\n  button: true,\n  child: CustomAddButton(...),\n)\n\n// Group related elements into a single announcement\nMergeSemantics(\n  child: Row(\n    children: [\n      Icon(Icons.star),\n      Text('4.5'),\n    ],\n  ),\n)\n\n// Hide decorative elements from screen readers\nExcludeSemantics(\n  child: DecorativeBackground(),\n)\n```\n\n \n\n### When to use each\n\n    Widget Use case     ` Semantics(label:) ` Custom widgets that lack built-in semantics (raw GestureDetector, Container with onTap)   ` Semantics(button: true) ` Custom buttons not using Material ` ElevatedButton `/` TextButton `   ` Semantics(header: true) ` Section headers (category names in a catalog)   ` Semantics(image: true, label:) ` Product/content images   ` MergeSemantics ` Icon + text pairs, price + currency pairs   ` ExcludeSemantics ` Purely decorative images, background gradients, dividers    \n\nMaterial widgets (` ElevatedButton `, ` TextField `, ` Checkbox `) already have built-in semantics. Do NOT double-wrap them unless overriding the default label.\n\n  \n\n## 2. Color Contrast\n\n \n\nFollow WCAG 2.1 minimum contrast ratios:\n\n    Element Minimum ratio     Normal text (\\< 18sp) **4.5:1**   Large text (\\>= 18sp or \\>= 14sp bold) **3.0:1**   UI components & graphical objects **3.0:1**    \n\n### Verification\n\n \n\n- Use the **Accessibility Scanner** on Android (Settings \\> Accessibility) \n- Run **Lighthouse** audit in Chrome DevTools for the web build \n- Use online contrast checkers (WebAIM Contrast Checker) with hex values from ` ds_colors.dart `\n\n \n\n### Violations that show up again and again\n\n \n\n- Light gray text on white backgrounds for secondary info (descriptions, prices in light theme) \n- Disabled button text that falls below 3.0:1 \n- Placeholder text in search fields\n\n \n\nWhen fixing, update colors in ` design_system/ ` tokens so the fix propagates everywhere.\n\n  \n\n## 3. Tap Targets\n\n \n\nAll interactive elements must be at least **48x48 logical pixels**:\n\n \n\n```\n// BAD - icon button too small\nGestureDetector(\n  onTap: onAdd,\n  child: Icon(Icons.add, size: 24),\n)\n\n// GOOD - ensure minimum hit area\nIconButton(\n  onPressed: onAdd,\n  icon: Icon(Icons.add, size: 24),\n  // IconButton already enforces 48x48 by default\n)\n\n// GOOD - for custom widgets, use constraints\nGestureDetector(\n  onTap: onAdd,\n  child: ConstrainedBox(\n    constraints: const BoxConstraints(minWidth: 48, minHeight: 48),\n    child: Center(child: Icon(Icons.add, size: 24)),\n  ),\n)\n```\n\n \n\n### Spacing between targets\n\n \n\nAdjacent tap targets must have enough spacing to avoid accidental taps. Minimum **8px** gap between interactive elements.\n\n  \n\n## 4. Screen Reader Support\n\n \n\n### Labels for images (product photos, avatars, thumbnails)\n\n \n\n```\n// Product image in a catalog\nSemantics(\n  image: true,\n  label: 'Foto do produto: ${product.name}',\n  child: CachedNetworkImage(\n    imageUrl: product.imageUrl,\n    // ...\n  ),\n)\n\n// Decorative images (backgrounds, patterns)\nExcludeSemantics(\n  child: Image.asset('assets/background_pattern.png'),\n)\n```\n\n \n\n### Labels for icon buttons\n\n \n\n```\nIconButton(\n  icon: Icon(Icons.shopping_cart),\n  tooltip: 'Ver carrinho', // tooltip doubles as semantic label\n  onPressed: () => openCart(),\n)\n```\n\n \n\n### Price announcements\n\n \n\n```\n// Announce price clearly\nMergeSemantics(\n  child: Row(\n    children: [\n      Text('R\\$'),\n      Text('29,90'),\n    ],\n  ),\n)\n// Screen reader announces: \"R$ 29,90\"\n```\n\n  \n\n## 5. Web Accessibility (any web build)\n\n \n\nFlutter web **disables semantics by default** for performance. For customer-facing apps this is unacceptable.\n\n \n\n### Enable semantics in web builds\n\n \n\nIn the app's ` web/index.html `, add before the Flutter loader script:\n\n \n\n```\n<script>\n  // Enable accessibility for Flutter web\n  window.flutterConfiguration = {\n    canvasKitBaseUrl: '/canvaskit/',\n  };\n</script>\n```\n\n \n\nIn the app's ` main.dart `:\n\n \n\n```\nimport 'package:flutter/semantics.dart';\n\nvoid main() {\n  // Force enable semantics for web accessibility\n  WidgetsFlutterBinding.ensureInitialized();\n  SemanticsBinding.instance.ensureSemantics();\n\n  runApp(const MyApp());\n}\n```\n\n \n\n### Alternative: enable via URL parameter\n\n \n\nFor testing, append ` ?semantics=true ` to the web URL to activate the semantics tree without code changes.\n\n \n\n### Web-specific considerations\n\n \n\n- Ensure the HTML ` <title> ` tag is descriptive (e.g., \"Product Catalog — Acme\") \n- Add ` lang=\"pt-BR\" ` to the ` <html> ` tag in ` index.html ` \n- Flutter web renders to canvas, so ALL accessibility depends on the Semantics tree being correct\n\n  \n\n## 6. Font Scaling\n\n \n\nSupport dynamic text sizing for users who increase system font size:\n\n \n\n```\n// BAD - breaks with large fonts\nSizedBox(\n  height: 48,\n  child: Text('Categoria', style: TextStyle(fontSize: 16)),\n)\n\n// GOOD - adapt to text scale\nConstrainedBox(\n  constraints: const BoxConstraints(minHeight: 48),\n  child: Text('Categoria', style: TextStyle(fontSize: 16)),\n)\n```\n\n \n\n### Guidelines\n\n \n\n- Use ` minHeight ` / ` minWidth ` instead of fixed ` height ` / ` width ` for containers holding text \n- Test with system font scale at **2.0x** (Settings \\> Display \\> Font size) \n- Ensure text does not overflow or get clipped — use ` Flexible `, ` Expanded `, or ` overflow: TextOverflow.ellipsis ` with ` maxLines ` \n- Product names and descriptions must remain readable at large scales\n\n \n\n### Limiting scale when necessary\n\n \n\nOnly limit scale factor for truly constrained UI (e.g., small price badges):\n\n \n\n```\nMediaQuery.withClampedTextScaling(\n  minScaleFactor: 1.0,\n  maxScaleFactor: 1.5,\n  child: PriceBadge(...),\n)\n```\n\n  \n\n## 7. Focus Management (Web)\n\n \n\nKeyboard navigation is essential for web accessibility:\n\n \n\n```\n// Ensure custom interactive widgets can receive focus\nFocus(\n  child: GestureDetector(\n    onTap: onTap,\n    child: MenuItemCard(...),\n  ),\n)\n\n// Set logical focus traversal order\nFocusTraversalGroup(\n  policy: OrderedTraversalPolicy(),\n  child: Column(\n    children: [\n      FocusTraversalOrder(\n        order: NumericFocusOrder(1),\n        child: SearchBar(),\n      ),\n      FocusTraversalOrder(\n        order: NumericFocusOrder(2),\n        child: CategoryFilter(),\n      ),\n      FocusTraversalOrder(\n        order: NumericFocusOrder(3),\n        child: ProductGrid(),\n      ),\n    ],\n  ),\n)\n```\n\n \n\n### Keyboard shortcuts for the web build\n\n \n\n- **Tab** — move between interactive elements \n- **Enter/Space** — activate buttons \n- **Escape** — close modals/bottom sheets\n\n \n\nEnsure all modals trap focus (Material ` showDialog ` and ` showModalBottomSheet ` do this automatically).\n\n  \n\n## 8. Accessible Images\n\n \n\nEvery meaningful image needs descriptive text:\n\n \n\n```\n// Product image\nSemantics(\n  image: true,\n  label: product.name, // \"Pizza Margherita\"\n  child: ProductImage(url: product.imageUrl),\n)\n\n// Category icon\nSemantics(\n  image: true,\n  label: 'Categoria: ${category.name}',\n  child: CategoryIcon(icon: category.icon),\n)\n\n// Restaurant logo\nSemantics(\n  image: true,\n  label: 'Logo do restaurante ${restaurant.name}',\n  child: RestaurantLogo(url: restaurant.logoUrl),\n)\n\n// Decorative divider — exclude\nExcludeSemantics(\n  child: Image.asset('assets/divider_ornament.png'),\n)\n```\n\n  \n\n## 9. Accessible Forms\n\n \n\nForms (search, checkout, sign-up) must announce labels and errors:\n\n \n\n```\nTextFormField(\n  decoration: InputDecoration(\n    labelText: 'Nome completo', // announced by screen reader\n    hintText: 'Digite seu nome',\n    errorText: hasError ? 'Nome e obrigatorio' : null, // announced on error\n  ),\n  validator: (value) {\n    if (value == null || value.isEmpty) {\n      return 'Nome e obrigatorio'; // announced when validation fails\n    }\n    return null;\n  },\n)\n```\n\n \n\n### Guidelines\n\n \n\n- Always use ` labelText ` on ` InputDecoration `, not just ` hintText ` (hints disappear on focus) \n- Error messages must be descriptive: say what is wrong, not just \"campo invalido\" \n- After form submission with errors, move focus to the first field with an error \n- Group related fields with ` MergeSemantics ` or ` Semantics(label:) ` when context is needed\n\n  \n\n## 10. Audit Workflow\n\n \n\n### When mode is ` audit `\n\n \n\n1. **Scan widgets** for missing ` Semantics ` on:\n\n \n\n- Images (` Image `, ` CachedNetworkImage `, ` SvgPicture `) \n- Custom buttons (` GestureDetector `, ` InkWell ` without ` Semantics `) \n- Icon-only buttons without ` tooltip ` \n- Decorative elements that should use ` ExcludeSemantics ` \n1. **Check tap target sizes** — find interactive widgets with constrained sizes below 48x48 \n1. **Review color usage** — cross-reference text colors against background colors in the design system tokens \n1. **Check web semantics** — verify ` SemanticsBinding.instance.ensureSemantics() ` is called in every web build \n1. **Check font scaling** — find fixed ` height `/` width ` on containers holding text \n1. **Produce report** in this format:\n\n \n\n```\n## Accessibility Audit: [app_name]\n\n### Critical (must fix)\n- [ ] Issue description — file:line\n\n### Important (should fix)\n- [ ] Issue description — file:line\n\n### Minor (nice to have)\n- [ ] Issue description — file:line\n```\n\n \n\n### Manual testing checklist\n\n    Platform Tool How to test     Android TalkBack Settings \\> Accessibility \\> TalkBack. Navigate the app with swipe gestures.   iOS VoiceOver Settings \\> Accessibility \\> VoiceOver. Swipe to navigate.   macOS VoiceOver Cmd+F5. Use arrow keys to navigate web apps in Safari/Chrome.   Web Lighthouse Chrome DevTools \\> Lighthouse \\> Accessibility. Target score \\>= 90.   Web axe DevTools Chrome extension. Finds WCAG violations in rendered page.   Web Tab navigation Press Tab through the entire checkout/browse flow without using a mouse.    \n\n### Lighthouse audit for the web build\n\n \n\n```\n# Run Lighthouse CI from command line\nnpx lighthouse http://localhost:PORT --only-categories=accessibility --output=json --output-path=./a11y-report.json\n```\n\n \n\nTarget: **Lighthouse accessibility score \\>= 90** for the web build.\n\n \n\n## Files\n\n \n\n- ` LICENSE ` \n- ` SKILL.md ` \n- ` SOURCE.md `\n\n \n\n## Related terms\n\n \n\n- [Flutter Accessibility](<https://delaparra-services.nl/knowledge-hub/flutter-accessibility>)\n\n \n\n## Related services\n\n \n\n- [App development](<https://delaparra-services.nl/services#service-02>)\n\n \n\n[Installing an agent skill in Claude Code, Codex, Cursor and Copilot](<https://delaparra-services.nl/manuals/een-skill-installeren-in-je-ai-assistent>)\n\n[HTML version](https://delaparra-services.nl/skills/flutter-accessibility)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "WebPage",
                "@id": "https://delaparra-services.nl/skills/flutter-accessibility#webpage",
                "url": "https://delaparra-services.nl/skills/flutter-accessibility",
                "name": "Run Lighthouse CI from command line | DeLaParra Services",
                "description": "Use when implementing or auditing accessibility on a Flutter screen — the Semantics widget, screen-reader labels (TalkBack/VoiceOver), colour contrast, minimum tap-target size, system font scaling, or semantics in a web build. Also triggers on \"make this accessible\", \"a11y\", or a request for an accessibility review.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/skills/flutter-accessibility#breadcrumb"
                }
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/skills/flutter-accessibility#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Run Lighthouse CI from command line"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "SoftwareSourceCode",
                "@id": "https://delaparra-services.nl/skills/flutter-accessibility#skill",
                "url": "https://delaparra-services.nl/skills/flutter-accessibility",
                "name": "Run Lighthouse CI from command line",
                "description": "Use when implementing or auditing accessibility on a Flutter screen — the Semantics widget, screen-reader labels (TalkBack/VoiceOver), colour contrast, minimum tap-target size, system font scaling, or semantics in a web build. Also triggers on \"make this accessible\", \"a11y\", or a request for an accessibility review.",
                "inLanguage": "en",
                "license": "https://spdx.org/licenses/MIT.html",
                "subjectOf": {
                    "@id": "https://delaparra-services.nl/skills/flutter-accessibility#dataset"
                }
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/skills/flutter-accessibility#dataset",
                "name": "Run Lighthouse CI from command line",
                "description": "Use when implementing or auditing accessibility on a Flutter screen — the Semantics widget, screen-reader labels (TalkBack/VoiceOver), colour contrast, minimum tap-target size, system font scaling, or semantics in a web build. Also triggers on \"make this accessible\", \"a11y\", or a request for an accessibility review.",
                "url": "https://delaparra-services.nl/skills/flutter-accessibility",
                "identifier": "https://delaparra-services.nl/skills/flutter-accessibility#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/skills/flutter-accessibility#skill"
                },
                "creditText": "gabuldev/flutter-skills",
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://spdx.org/licenses/MIT.html",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "dateModified": "2026-11-30T13:17:19+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#skills",
                    "name": "Skills for AI coding assistants",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "flutter-accessibility.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-accessibility.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-accessibility.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-accessibility.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-accessibility.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-accessibility.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-accessibility.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-accessibility.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-accessibility.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-accessibility.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "flutter-accessibility-files.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/skills/flutter-accessibility/download",
                        "inLanguage": "en",
                        "dateModified": "2026-11-30T13:17:19+00:00",
                        "license": "https://spdx.org/licenses/MIT.html"
                    }
                ]
            }
        ]
    }
}