📖

[Flutter]Semantics

2022/11/25に公開

https://youtu.be/NvtMt_DtFrQ
https://api.flutter.dev/flutter/widgets/Semantics-class.html

Semantics

それぞれのUIの部分が何を意味するかを示すwidget(ウィジェットツリーに注釈を付けるWidget)
アプリケーションの意味を判断するために、スクリーンリーダーやアクセシビリティツール、検索エンジン、およびその他の解析ソフトウェア(検証ツール)で使用される。

Semantics(
 child: FaceImage(
  file: '$name.png',
 ),
 label: 'An image of $name.",
 enabled: true,
 readOnly: true,
)

SemanticsでWidgetをラップすることで、情報を得ることができる
label,enabled,readOnlyなど、テキスト記述のようなプロパティが50個近くあり、UIの詳細を提供することができる

Discussion