From 08ef009131976beebb1905c2f573f6868efbd82c Mon Sep 17 00:00:00 2001 From: Alex Li Date: Sat, 9 Dec 2023 11:29:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20close=20button=20semantics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/delegates/asset_picker_builder_delegate.dart | 7 +++++-- .../delegates/asset_picker_viewer_builder_delegate.dart | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/src/delegates/asset_picker_builder_delegate.dart b/lib/src/delegates/asset_picker_builder_delegate.dart index 065cb3af..6ef4cbd1 100644 --- a/lib/src/delegates/asset_picker_builder_delegate.dart +++ b/lib/src/delegates/asset_picker_builder_delegate.dart @@ -570,8 +570,11 @@ abstract class AssetPickerBuilderDelegate { padding: const EdgeInsets.symmetric(vertical: 4), child: IconButton( onPressed: Navigator.of(context).maybePop, - tooltip: MaterialLocalizations.of(context).backButtonTooltip, - icon: const Icon(Icons.close), + tooltip: MaterialLocalizations.of(context).closeButtonTooltip, + icon: Icon( + Icons.close, + semanticLabel: MaterialLocalizations.of(context).closeButtonTooltip, + ), ), ); } diff --git a/lib/src/delegates/asset_picker_viewer_builder_delegate.dart b/lib/src/delegates/asset_picker_viewer_builder_delegate.dart index 19783c3c..453239ce 100644 --- a/lib/src/delegates/asset_picker_viewer_builder_delegate.dart +++ b/lib/src/delegates/asset_picker_viewer_builder_delegate.dart @@ -702,9 +702,12 @@ class DefaultAssetPickerViewerBuilderDelegate leading: Semantics( sortKey: ordinalSortKey(0), child: IconButton( - tooltip: MaterialLocalizations.of(context).backButtonTooltip, onPressed: Navigator.of(context).maybePop, - icon: const Icon(Icons.close), + tooltip: MaterialLocalizations.of(context).closeButtonTooltip, + icon: Icon( + Icons.close, + semanticLabel: MaterialLocalizations.of(context).closeButtonTooltip, + ), ), ), centerTitle: true,