Skip to content

Commit e4b1dc7

Browse files
authored
🚑️ Fix the broken semantics on iOS (#272)
1 parent a4cc265 commit e4b1dc7

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

lib/src/delegates/asset_picker_builder_delegate.dart

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ import '../widget/gaps.dart';
3232
import '../widget/platform_progress_indicator.dart';
3333
import '../widget/scale_text.dart';
3434

35-
const String _ordinalNamePermissionOverlay = 'permissionOverlay';
36-
3735
/// The delegate to build the whole picker's components.
3836
///
3937
/// By extending the delegate, you can customize every components on you own.
@@ -179,8 +177,8 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
179177
ValueNotifier<PermissionState>(
180178
initialPermission,
181179
);
182-
final ValueNotifier<bool> permissionOverlayHidden =
183-
ValueNotifier<bool>(false);
180+
late final ValueNotifier<bool> permissionOverlayHidden =
181+
ValueNotifier<bool>(permission.value.isAuth);
184182

185183
/// Whether the permission is limited currently.
186184
/// 当前的权限是否为受限
@@ -617,10 +615,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
617615
}
618616
return Positioned.fill(
619617
child: Semantics(
620-
sortKey: const OrdinalSortKey(
621-
0,
622-
name: _ordinalNamePermissionOverlay,
623-
),
618+
sortKey: const OrdinalSortKey(0),
624619
child: Container(
625620
padding: context.mediaQuery.padding,
626621
color: context.themeData.canvasColor,
@@ -1003,11 +998,7 @@ class DefaultAssetPickerBuilderDelegate
1003998
if (value) {
1004999
return child!;
10051000
}
1006-
return Semantics(
1007-
excludeSemantics: true,
1008-
sortKey: const OrdinalSortKey(1, name: _ordinalNamePermissionOverlay),
1009-
child: child,
1010-
);
1001+
return ExcludeSemantics(child: child);
10111002
},
10121003
child: _layout(context),
10131004
);

0 commit comments

Comments
 (0)