Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 23df3e6

Browse files
authored
Revert "Add support for on/off switch labels when built on iOS 13. (#12467)" (#15370)
Broke a fake implementation of Accessibility features in the framework. While this change is unlikely to break any users in the wild, this is a breaking change by the standards set out in our documentation and should follow the breaking change announcement process. Details can be found at https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes. The error in question: Missing concrete implementation of 'getter AccessibilityFeatures.onOffSwitchLabels' • packages/flutter_test/test/window_test.dart:252:7 • non_abstract_class_inherits_abstract_member This reverts commit d12f2a6.
1 parent 4513205 commit 23df3e6

4 files changed

Lines changed: 0 additions & 29 deletions

File tree

lib/ui/window.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,6 @@ class AccessibilityFeatures {
12131213
static const int _kDisableAnimationsIndex = 1 << 2;
12141214
static const int _kBoldTextIndex = 1 << 3;
12151215
static const int _kReduceMotionIndex = 1 << 4;
1216-
static const int _kOnOffSwitchLabelsIndex = 1 << 5;
12171216

12181217
// A bitfield which represents each enabled feature.
12191218
final int _index;
@@ -1241,11 +1240,6 @@ class AccessibilityFeatures {
12411240
/// Only supported on iOS.
12421241
bool get reduceMotion => _kReduceMotionIndex & _index != 0;
12431242

1244-
/// The platform is requesting that on/off labels be added to switches.
1245-
///
1246-
/// Only supported on iOS.
1247-
bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0;
1248-
12491243
@override
12501244
String toString() {
12511245
final List<String> features = <String>[];
@@ -1259,8 +1253,6 @@ class AccessibilityFeatures {
12591253
features.add('boldText');
12601254
if (reduceMotion)
12611255
features.add('reduceMotion');
1262-
if (onOffSwitchLabels)
1263-
features.add('onOffSwitchLabels');
12641256
return 'AccessibilityFeatures$features';
12651257
}
12661258

lib/ui/window/window.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ enum class AccessibilityFeatureFlag : int32_t {
4444
kDisableAnimations = 1 << 2,
4545
kBoldText = 1 << 3,
4646
kReduceMotion = 1 << 4,
47-
kOnOffSwitchLabels = 1 << 5,
4847
};
4948

5049
class WindowClient {

lib/web_ui/lib/src/ui/window.dart

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,6 @@ class AccessibilityFeatures {
995995
static const int _kDisableAnimationsIndex = 1 << 2;
996996
static const int _kBoldTextIndex = 1 << 3;
997997
static const int _kReduceMotionIndex = 1 << 4;
998-
static const int _kOnOffSwitchLabelsIndex = 1 << 5;
999998

1000999
// A bitfield which represents each enabled feature.
10011000
final int _index;
@@ -1023,11 +1022,6 @@ class AccessibilityFeatures {
10231022
/// Only supported on iOS.
10241023
bool get reduceMotion => _kReduceMotionIndex & _index != 0;
10251024

1026-
/// The platform is requesting that on/off labels be added to switches.
1027-
///
1028-
/// Only supported on iOS.
1029-
bool get onOffSwitchLabels => _kOnOffSwitchLabelsIndex & _index != 0;
1030-
10311025
@override
10321026
String toString() {
10331027
final List<String> features = <String>[];
@@ -1046,9 +1040,6 @@ class AccessibilityFeatures {
10461040
if (reduceMotion) {
10471041
features.add('reduceMotion');
10481042
}
1049-
if (onOffSwitchLabels) {
1050-
features.add('onOffSwitchLabels');
1051-
}
10521043
return 'AccessibilityFeatures$features';
10531044
}
10541045

shell/platform/darwin/ios/framework/Source/FlutterViewController.mm

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,6 @@ - (void)setupNotificationCenterObservers {
238238
selector:@selector(onUserSettingsChanged:)
239239
name:UIContentSizeCategoryDidChangeNotification
240240
object:nil];
241-
242-
if (@available(iOS 13, *)) {
243-
[center addObserver:self
244-
selector:@selector(onAccessibilityStatusChanged:)
245-
name:UIAccessibilityOnOffSwitchLabelsDidChangeNotification
246-
object:nil];
247-
}
248241
}
249242

250243
- (void)setInitialRoute:(NSString*)route {
@@ -896,10 +889,6 @@ - (void)onAccessibilityStatusChanged:(NSNotification*)notification {
896889
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kReduceMotion);
897890
if (UIAccessibilityIsBoldTextEnabled())
898891
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kBoldText);
899-
if (@available(iOS 13, *)) {
900-
if (UIAccessibilityIsOnOffSwitchLabelsEnabled())
901-
flags |= static_cast<int32_t>(flutter::AccessibilityFeatureFlag::kOnOffSwitchLabels);
902-
}
903892
#if TARGET_OS_SIMULATOR
904893
// There doesn't appear to be any way to determine whether the accessibility
905894
// inspector is enabled on the simulator. We conservatively always turn on the

0 commit comments

Comments
 (0)