Skip to content

Commit e17c1a2

Browse files
authored
🐛 Fix semantics (#691)
1 parent 2d56351 commit e17c1a2

File tree

4 files changed

+22
-27
lines changed

4 files changed

+22
-27
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ that can be found in the LICENSE file. -->
1414
- Improve how `MediaQuery` is being listened.
1515
- Stop enabling drag to select when `maxAssets == 1`.
1616

17+
**Fixes**
18+
19+
- Fix semantics with the close button.
20+
1721
## 9.5.1
1822

1923
**Improvements**

example/lib/widgets/method_list_view.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ class _MethodListViewState extends State<MethodListView> {
4040
width: 48,
4141
height: 48,
4242
child: Center(
43-
child: Text(
44-
model.icon,
45-
style: const TextStyle(fontSize: 28.0),
43+
child: ExcludeSemantics(
44+
child: Text(
45+
model.icon,
46+
style: const TextStyle(fontSize: 28.0),
47+
),
4648
),
4749
),
4850
),

lib/src/delegates/asset_picker_builder_delegate.dart

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -696,14 +696,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
696696
Navigator.maybeOf(context)?.maybePop();
697697
},
698698
tooltip: MaterialLocalizations.of(context).closeButtonTooltip,
699-
icon: Icon(
700-
Icons.close,
701-
semanticLabel: switch (Theme.of(context).platform) {
702-
TargetPlatform.android =>
703-
MaterialLocalizations.of(context).closeButtonTooltip,
704-
_ => null,
705-
},
706-
),
699+
icon: const Icon(Icons.close),
707700
),
708701
);
709702
}
@@ -772,14 +765,17 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
772765
),
773766
);
774767

775-
final Widget accessLimitedButton = GestureDetector(
776-
onTap: () {
777-
permissionOverlayDisplay.value = false;
778-
},
779-
child: ScaleText(
780-
textDelegate.accessLimitedAssets,
781-
style: TextStyle(color: interactiveTextColor(context)),
782-
semanticsLabel: semanticsTextDelegate.accessLimitedAssets,
768+
final Widget accessLimitedButton = Semantics(
769+
label: semanticsTextDelegate.accessLimitedAssets,
770+
button: true,
771+
child: GestureDetector(
772+
onTap: () {
773+
permissionOverlayDisplay.value = false;
774+
},
775+
child: ScaleText(
776+
textDelegate.accessLimitedAssets,
777+
style: TextStyle(color: interactiveTextColor(context)),
778+
),
783779
),
784780
);
785781

lib/src/delegates/asset_picker_viewer_builder_delegate.dart

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -733,14 +733,7 @@ class DefaultAssetPickerViewerBuilderDelegate
733733
Navigator.maybeOf(context)?.maybePop();
734734
},
735735
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
736-
icon: Icon(
737-
Icons.arrow_back_ios_new,
738-
semanticLabel: switch (Theme.of(context).platform) {
739-
TargetPlatform.android =>
740-
MaterialLocalizations.of(context).backButtonTooltip,
741-
_ => null,
742-
},
743-
),
736+
icon: const Icon(Icons.arrow_back_ios_new),
744737
),
745738
),
746739
centerTitle: true,

0 commit comments

Comments
 (0)