Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

flutter-accessibility

/flutter-accessibility

Dodaje do aplikacji Flutter dostępność: semantykę, etykiety, cele dotyku, kontrast i testy TalkBack oraz VoiceOver.

Licencja
MIT
Ostatnia zmiana repozytorium
05.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 05.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Dodaje do aplikacji Flutter dostępność: semantykę, etykiety, cele dotyku, kontrast i testy TalkBack oraz VoiceOver.

Oryginalny opis (EN)

Flutter accessibility (a11y) — Semantics widget and properties (label, button, header, liveRegion, excludeSemantics, MergeSemantics), labels for icons and images, TalkBack/VoiceOver testing, focus order and keyboard navigation (FocusTraversalGroup, Shortcuts/Actions), minimum tap targets (48x48), color contrast (WCAG 4.5:1), text scaling with TextScaler, reduced motion, and automated checks with meetsGuideline in widget tests. Use when building or reviewing UI for accessibility, fixing screen-reader issues, or adding a11y tests.

Jak działa

  1. Semantics basics
  2. Tap targets
  3. Text scaling
  4. Contrast and color
  5. Focus and keyboard
  6. Motion
  7. Automated checks (widget tests)
  8. Manual check
Sekcje z nagłówków SKILL.md, w oryginale · 82 linii, 510 słów
Podgląd SKILL.md
---
name: flutter-accessibility
description: "Flutter accessibility (a11y) — Semantics widget and properties (label, button, header, liveRegion, excludeSemantics, MergeSemantics), labels for icons and images, TalkBack/VoiceOver testing, focus order and keyboard navigation (FocusTraversalGroup, Shortcuts/Actions), minimum tap targets (48x48), color contrast (WCAG 4.5:1), text scaling with TextScaler, reduced motion, and automated checks with meetsGuideline in widget tests. Use when building or reviewing UI for accessibility, fixing screen-reader issues, or adding a11y tests."
license: MIT
metadata:
  author: Matiss Kalnins
  version: "0.5.0"
---

**Persona:** You check every screen against a screen reader, 200% text, and keyboard-only navigation before calling it done. Accessibility is a requirement, not polish.

## Semantics basics

Most Material widgets already provide semantics (buttons, text fields, switches). Gaps usually come from **custom widgets** built on `GestureDetector`/`InkWell` and from **icon-only or image-only** controls.

```dart
// Icon-only button: always give a tooltip or semantic label
IconButton(icon: const Icon(Icons.delete), tooltip: "Delete item", onPressed: _delete);

// Meaningful image
Image.asset("assets/chart.png", semanticLabel: "Sales up 12% this month");

// Decorative image: hide from screen readers
const Image(image: AssetImage("assets/divider.png"), excludeFromSemantics: true);

// Custom tappable
Semantics(
  button: true,
  label: "Add to favorites",
  selected: isFavorite,
  child: GestureDetector(onTap: _toggle, child: HeartIcon(filled: isFavorite)),
);
```

- **`MergeSemantics`**: reads a row (icon + title + subtitle) as one item. `ListTile` already does this.
- **`ExcludeSemantics`** / `excludeSemantics: true`: hides redundant children.
- **`Semantics(header: true)`**: marks section titles, so screen-reader users can jump between headings.
- **`Semantics(liveRegion: true)`**: announces dynamic status (e.g. "3 results"). Or call `SemanticsService.announce(...)` for one-off messages.
- Labels describe purpose, not appearance: "Search", not "Magnifying glass".

## Tap targets

Interactive elements need at least **48×48 dp** on Android and **44×44 pt** on iOS. Material buttons enforce this through `MaterialTapTargetSize.padded`. For custom widgets, pad them with `SizedBox`/`ConstrainedBox(constraints: BoxConstraints(minWidth: 48, minHeight: 48))`.

## Text scaling

- Never set a fixed `height` on containers that hold text. Let them grow.
- Test at large scales: `MediaQuery(data: MediaQuery.of(context).copyWith(textScaler: .linear(2.0)), ...)`, or use the device's accessibility settings.
- Don't block scaling globally. If one dense element really must be limited, clamp it there: `MediaQuery.withClampedTextScaling(maxScaleFactor: 1.5, child: ...)`.
- Make rows wrap or switch to a Column when text gets large (`Wrap`, `LayoutBuilder`, `OverflowBar`).

## Contrast and color

- Text contrast should be at least **4.5:1** (3:1 for large text and UI components). Check every text/background pair you use from `AppColors` (see `flutter-theming`) when the palette changes.
- Never use color alone to convey state. Add an icon, text, or pattern (e.g. an error icon next to red text).

## Focus and keyboard

- Logical reading/focus order follows the widget tree. Group related controls in `FocusTraversalGroup`, and override the order with `FocusTraversalOrder` only when the visual order differs.
- Every action must work by keyboard on desktop and web. Use `Shortcuts` + `Actions`, or `CallbackShortcuts`, for keyboard accelerators.
- Move focus deliberately after navigation or errors (`FocusScope.of(context).requestFocus(_errorField)`).

## Motion

Respect `MediaQuery.disableAnimationsOf(context)`: skip or shorten non-essential animations, parallax, and auto-playing motion.

## Automated checks (widget tests)

```dart
testWidgets("checkout meets a11y guidelines", (tester) async {
  final SemanticsHandle handle = tester.ensureSemantics();
  await tester.pumpWidget(const MaterialApp(home: CheckoutPage()));

  await expectLater(tester, meetsGuideline(androidTapTargetGuideline));
  await expectLater(tester, meetsGuideline(iOSTapTargetGuideline));
  await expectLater(tester, meetsGuideline(labeledTapTargetGuideline));
  await expectLater(tester, meetsGuideline(textContrastGuideline));

  expect(find.bySemanticsLabel("Place order"), findsOneWidget);
  handle.dispose();
});
```

## Manual check

1. Turn on TalkBack (Android) or VoiceOver (iOS) and complete the main flow without looking at the screen.
2. Set the device font to its largest size, and check nothing is clipped or overflows.
3. On desktop/web, complete the flow with the keyboard only.
4. Use the Flutter Inspector's semantics view, or `showSemanticsDebugger: true` on `MaterialApp`, to see what the screen reader sees.

Wersje

RepozytoriumWynikLicencja
Ta strona · Dee9975/cc-skills-flutter100MIT
gabuldev/flutter-skills100MIT

Migawka bazy z 13.11.2026 · wersja paczki 9eaacf8b03af (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100accessibility
    Sprawdza i poprawia dostępność aplikacji Flutter: etykiety dla czytników ekranu, rozmiary celów dotyku i kontrast.
  • 100accessibility
    Audytuje lub naprawia widgety Flutter pod WCAG 2.2 (A, AA, AAA) na iOS, Android, web, macOS, Windows i Linux: etykiety, czytniki ekranu, cele dotyku, kontrast i skalowanie tekstu.
  • 100accessibility-as-code
    Wymusza etykiety dostępności, cele dotyku 44pt, skalowanie tekstu do 200 proc. oraz wsparcie VoiceOver i TalkBack przy dodawaniu elementów dotykowych i gestów.
  • 100accessibility-as-code
    Wymusza dostępność jako właściwość kodu w każdym widgecie: etykiety Semantics, stan dostępności z MediaQuery, kontrast i minimalne cele dotyku 44px.
  • 95accessibility-testing
    Testuje dostępność aplikacji iOS: etykiety, VoiceOver, kontrast kolorów i zgodność z WCAG 2.1.
  • 100mobile-a11y-test-author
    Pisze natywne testy dostępności mobilnej dla iOS (XCUITest, VoiceOver) i Androida (Espresso, TalkBack), sprawdzając etykiety, obszary dotyku 44pt i 48dp, kontrast i kolejność fokusu zgodnie z WCAG.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.