diff --git a/packages/flutter/lib/src/semantics/semantics.dart b/packages/flutter/lib/src/semantics/semantics.dart index 4e60571106f6..5a7c52674e15 100644 --- a/packages/flutter/lib/src/semantics/semantics.dart +++ b/packages/flutter/lib/src/semantics/semantics.dart @@ -669,6 +669,7 @@ class SemanticsData with Diagnosticable { properties.add(DoubleProperty('elevation', elevation, defaultValue: 0.0)); properties.add(DoubleProperty('thickness', thickness, defaultValue: 0.0)); final List actionSummary = [ + // ignore: deprecated_member_use for (final SemanticsAction action in SemanticsAction.doNotUseWillBeDeletedWithoutWarningValuesAsList) if ((actions & action.index) != 0) describeEnum(action), @@ -680,6 +681,7 @@ class SemanticsData with Diagnosticable { properties.add(IterableProperty('customActions', customSemanticsActionSummary, ifEmpty: null)); final List flagSummary = [ + // ignore: deprecated_member_use for (final SemanticsFlag flag in SemanticsFlag.doNotUseWillBeDeletedWithoutWarningValuesAsList) if ((flags & flag.index) != 0) describeEnum(flag), @@ -2755,6 +2757,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { .toList(); properties.add(IterableProperty('actions', actions, ifEmpty: null)); properties.add(IterableProperty('customActions', customSemanticsActions, ifEmpty: null)); + // ignore: deprecated_member_use final List flags = SemanticsFlag.doNotUseWillBeDeletedWithoutWarningValuesAsList.where((SemanticsFlag flag) => hasFlag(flag)).map((SemanticsFlag flag) => flag.toString().substring('SemanticsFlag.'.length)).toList(); properties.add(IterableProperty('flags', flags, ifEmpty: null)); properties.add(FlagProperty('isInvisible', value: isInvisible, ifTrue: 'invisible')); diff --git a/packages/flutter/test/widgets/custom_painter_test.dart b/packages/flutter/test/widgets/custom_painter_test.dart index 06aa53030ff1..02750e75a17f 100644 --- a/packages/flutter/test/widgets/custom_painter_test.dart +++ b/packages/flutter/test/widgets/custom_painter_test.dart @@ -346,6 +346,7 @@ void _defineTests() { ), ), )); + // ignore: deprecated_member_use final Set allActions = SemanticsAction.doNotUseWillBeDeletedWithoutWarningValuesAsList.toSet() ..remove(SemanticsAction.customAction) // customAction is not user-exposed. ..remove(SemanticsAction.showOnScreen); // showOnScreen is not user-exposed @@ -444,6 +445,7 @@ void _defineTests() { ), ), )); + // ignore: deprecated_member_use List flags = SemanticsFlag.doNotUseWillBeDeletedWithoutWarningValuesAsList.toList(); // [SemanticsFlag.hasImplicitScrolling] isn't part of [SemanticsProperties] // therefore it has to be removed. @@ -498,6 +500,7 @@ void _defineTests() { ), ), )); + // ignore: deprecated_member_use flags = SemanticsFlag.doNotUseWillBeDeletedWithoutWarningValuesAsList.toList(); // [SemanticsFlag.hasImplicitScrolling] isn't part of [SemanticsProperties] // therefore it has to be removed. diff --git a/packages/flutter/test/widgets/semantics_test.dart b/packages/flutter/test/widgets/semantics_test.dart index a0c6617e5ee2..a1d57307e94c 100644 --- a/packages/flutter/test/widgets/semantics_test.dart +++ b/packages/flutter/test/widgets/semantics_test.dart @@ -520,6 +520,7 @@ void main() { ), ); + // ignore: deprecated_member_use final Set allActions = SemanticsAction.doNotUseWillBeDeletedWithoutWarningValuesAsList.toSet() ..remove(SemanticsAction.moveCursorForwardByWord) ..remove(SemanticsAction.moveCursorBackwardByWord) @@ -612,6 +613,7 @@ void main() { liveRegion: true, ), ); + // ignore: deprecated_member_use final List flags = SemanticsFlag.doNotUseWillBeDeletedWithoutWarningValuesAsList.toList(); flags ..remove(SemanticsFlag.hasToggledState) diff --git a/packages/flutter/test/widgets/semantics_tester.dart b/packages/flutter/test/widgets/semantics_tester.dart index bd3050a353f1..245a4291de4c 100644 --- a/packages/flutter/test/widgets/semantics_tester.dart +++ b/packages/flutter/test/widgets/semantics_tester.dart @@ -633,6 +633,7 @@ class SemanticsTester { static String _flagsToSemanticsFlagExpression(dynamic flags) { Iterable list; if (flags is int) { + // ignore: deprecated_member_use list = SemanticsFlag.doNotUseWillBeDeletedWithoutWarningValuesAsList .where((SemanticsFlag flag) => (flag.index & flags) != 0); } else { @@ -648,6 +649,7 @@ class SemanticsTester { static String _actionsToSemanticsActionExpression(dynamic actions) { Iterable list; if (actions is int) { + // ignore: deprecated_member_use list = SemanticsAction.doNotUseWillBeDeletedWithoutWarningValuesAsList .where((SemanticsAction action) => (action.index & actions) != 0); } else { diff --git a/packages/flutter_test/test/matchers_test.dart b/packages/flutter_test/test/matchers_test.dart index f097e3711351..18b4fc498923 100644 --- a/packages/flutter_test/test/matchers_test.dart +++ b/packages/flutter_test/test/matchers_test.dart @@ -613,9 +613,11 @@ void main() { int actions = 0; int flags = 0; const CustomSemanticsAction action = CustomSemanticsAction(label: 'test'); + // ignore: deprecated_member_use for (final int index in SemanticsAction.doNotUseWillBeDeletedWithoutWarningKeys) { actions |= index; } + // ignore: deprecated_member_use for (final int index in SemanticsFlag.doNotUseWillBeDeletedWithoutWarningKeys) { flags |= index; } @@ -895,9 +897,11 @@ void main() { int actions = 0; int flags = 0; const CustomSemanticsAction action = CustomSemanticsAction(label: 'test'); + // ignore: deprecated_member_use for (final int index in SemanticsAction.doNotUseWillBeDeletedWithoutWarningKeys) { actions |= index; } + // ignore: deprecated_member_use for (final int index in SemanticsFlag.doNotUseWillBeDeletedWithoutWarningKeys) { flags |= index; } @@ -1081,9 +1085,11 @@ void main() { testWidgets('only matches given flags and actions', (WidgetTester tester) async { int allActions = 0; int allFlags = 0; + // ignore: deprecated_member_use for (final int index in SemanticsAction.doNotUseWillBeDeletedWithoutWarningKeys) { allActions |= index; } + // ignore: deprecated_member_use for (final int index in SemanticsFlag.doNotUseWillBeDeletedWithoutWarningKeys) { allFlags |= index; }