返回介绍

Accessibility

发布于 2019-12-09 21:31:23 字数 5059 浏览 878 评论 0 收藏 0

Flutter is committed to supporting developers who want to make their apps more accessible: usable by as many people as possible, including those with disabilities such as blindness or motor impairment.

Flutter supports three components for accessibility support:

Inspecting Accessibility support

Details of these are discussed below. In addition to testing for these specific topics, we recommend using automated accessibility scanners:

  • For Android:
    1. Install the Accessibility Scanner for Android
    2. Enable the Accessibility Scanner from Android Settings > Accessibility > Accessibility Scanner > On
    3. Navigate to the Accessibility Scanner ‘checkbox’ icon button to initiate a scan
  • For iOS:
    1. Open the iOS folder of your Flutter app in Xcode
    2. Select a Simulator as the target, and click Run button
    3. In Xcode, select Xcode > Open Developer Tools > Accessibility Inspector
    4. In the Accessibility Inspector, select Inspection > Enable Point to Inspect, and then select the various user interface elements in running Flutter app to inspect their accessibility attributes
    5. In the Accessibility Inspector, select Audit in the toolbar, and then select Run Audio to get a report of potential issues

Large fonts

Both Android and iOS contain system settings to configure the desired font sizes used by apps. Flutter text widgets respect this OS setting when determining font sizes.

Tips for developers

Font sizes are calculated automatically by Flutter based on the OS setting. However, as a developer you should make sure your layout has enough room to render all its contents when the font sizes are increased. For example you can test all parts of your app on a small-screen device configured to use the largest font setting.

Example

The following two screenshots show the standard Flutter app template rendered with the default iOS font setting, and with the largest font setting selected in iOS accessibility settings.

Default font setting
Default font setting
Largest accessibility font setting
Largest accessibility font setting

Screen readers

Screen readers (TalkBack, VoiceOver) enable visually impaired users to get spoken feedback about the contents of the screen.

Tips for developers

Turn on VoiceOver or TalkBack on your device and navigate around your app. If you run into any issues, use the Semantics widget to customize the accessibility experience of your app.

Sufficient contrast

Sufficient color contrast makes text and images easier to read. Along with benefitting users with various visual impairments, sufficient color contrast helps all users when viewing an interface on devices in extreme lighting conditions, such as when exposed to direct sunlight or on a display with low brightness.

The W3C recommends:

  • At least 4.5:1 for small text (below 18 point regular or 14 point bold)
  • At least 3.0:1 for large text (18 point and above regular or 14 point and above bold)

Tips for developers

Make sure any images you include have sufficient contrast.

When specifying colors on widgets, make sure sufficient contrast is used between foreground and background color selections.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文