Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Flutter製アプリのアクセシビリティ対応(音声読み上げ編) / Screen reading in Flutter app

Flutter製アプリのアクセシビリティ対応(音声読み上げ編) / Screen reading in Flutter app

2019.09.06 Flutter Meetup Tokyo #11 での15分LTのスライドです。

【訂正のお知らせ】
p.31 音声読み上げ機能がONの際にwidgetを表示させないためのvisible: への条件設定は「!MediaQuery.of(context).accessibleNavigation」(true/falseが逆)が正しいです。訂正してお詫びいたします。

Banno Takuya / NanoNano

September 06, 2019
Tweet

More Decks by Banno Takuya / NanoNano

Other Decks in Technology

Transcript

  1. 誰? • 坂野 匠弥 / なのなの • 株式会社アスネット 技術部 開発グループ所属

    • 業務は主にAndroidアプリエンジニア • Flutter歴: だらだらと約1年 • Twitter: @nano2_aloerina / GitHub: nano-nano 2
  2. 3

  3. 4

  4. 14

  5. ケーススタディ: 特定のパーツを読み上げさせない RaisedButton( onPressed: _incrementCounter, child: Text('Push Me!!'), ) Semantics(

    child: RaisedButton( onPressed: _incrementCounter, child: Text('Push Me!!'), ), excludeSemantics: true, ), 19
  6. 21

  7. Semantics widgetの主なコンストラクタ引数 • label ◦ 子ウィジェットの説明。読み上げ機能で読み上げられるテキストにな る • excludeSemantics ◦

    子ウィジェットに読み上げ機能のカーソルが当たらないようにするか どうか。trueで当たらない(=読み上げられない) • sortKey ◦ 子ウィジェットに読み上げ機能のカーソルが当たる順番。 22
  8. Appendix. 参考文献等 Accessibility - Flutter https://flutter.dev/docs/development/accessibility-and-localization/accessibility semantics library - Dart

    API https://api.flutter.dev/flutter/semantics/semantics-library.html Accessibility on Flutter - Carlos Macías Martín - Medium https://medium.com/@c4rlosmm96/accessibility-on-flutter-908a2f003013 A deep dive into Flutter’s accessibility widgets - Flutter Community - Medium https://medium.com/flutter-community/a-deep-dive-into-flutters-accessibility-widgets-eb0ef9455bc 29
  9. Appendix. 音声読み上げ機能のON/OFF確認 accessibility - How to check whether screen reader

    is on using Flutter - Stack Overflow https://stackoverflow.com/questions/54224069/how-to-check-whether-screen-reader-is-on-using-flutter MediaQuery.of(context).accessibleNavigation で判断できる (trueのとき、音声読み上げ機能がONになっている) Visibility( child: Placeholder(), visible: MediaQuery.of(context).accessibleNavigation, ) 音声読み上げ機能がONの場合、 Placeholder widgetを表示させない という実装例 31