From 60663bccf03a8f1dbaf66aeaf0adfca31d091b83 Mon Sep 17 00:00:00 2001 From: Bernardo Ferrari Date: Thu, 30 Mar 2023 15:32:38 -0300 Subject: [PATCH] `SemanticsFlag`/`SemanticsAction` enum migration (part 1) (flutter/engine#40571) `SemanticsFlag`/`SemanticsAction` enum migration (part 1) --- engine/src/flutter/lib/ui/semantics.dart | 20 +++++++++++++++++++ .../src/flutter/lib/web_ui/lib/semantics.dart | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/engine/src/flutter/lib/ui/semantics.dart b/engine/src/flutter/lib/ui/semantics.dart index 63a715eb91..d4da11eafd 100644 --- a/engine/src/flutter/lib/ui/semantics.dart +++ b/engine/src/flutter/lib/ui/semantics.dart @@ -228,6 +228,16 @@ class SemanticsAction { _kSetTextIndex: setText, }; + /// Temporary API until [values] return a list. + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This getter is temporary and will be removed shortly.') + static List get doNotUseWillBeDeletedWithoutWarningValuesAsList => values.values.toList(growable: false); + + /// Temporary API until [values] return a list. + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This getter is temporary and will be removed shortly.') + static Iterable get doNotUseWillBeDeletedWithoutWarningKeys => values.keys; + @override String toString() { switch (index) { @@ -598,6 +608,16 @@ class SemanticsFlag { _kIsCheckStateMixedIndex: isCheckStateMixed, }; + /// Temporary API until [values] return a list. + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This getter is temporary and will be removed shortly.') + static List get doNotUseWillBeDeletedWithoutWarningValuesAsList => values.values.toList(growable: false); + + /// Temporary API until [values] return a list. + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This getter is temporary and will be removed shortly.') + static Iterable get doNotUseWillBeDeletedWithoutWarningKeys => values.keys; + @override String toString() { switch (index) { diff --git a/engine/src/flutter/lib/web_ui/lib/semantics.dart b/engine/src/flutter/lib/web_ui/lib/semantics.dart index 262b6bd7bb..81f56500a8 100644 --- a/engine/src/flutter/lib/web_ui/lib/semantics.dart +++ b/engine/src/flutter/lib/web_ui/lib/semantics.dart @@ -80,6 +80,16 @@ class SemanticsAction { _kSetTextIndex: setText, }; + /// Temporary API until [values] return a list. + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This getter is temporary and will be removed shortly.') + static List get doNotUseWillBeDeletedWithoutWarningValuesAsList => values.values.toList(growable: false); + + /// Temporary API until [values] return a list. + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This getter is temporary and will be removed shortly.') + static Iterable get doNotUseWillBeDeletedWithoutWarningKeys => values.keys; + @override String toString() { switch (index) { @@ -221,6 +231,16 @@ class SemanticsFlag { _kIsCheckStateMixedIndex: isCheckStateMixed, }; + /// Temporary API until [values] return a list. + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This getter is temporary and will be removed shortly.') + static List get doNotUseWillBeDeletedWithoutWarningValuesAsList => values.values.toList(growable: false); + + /// Temporary API until [values] return a list. + /// https://github.com/flutter/flutter/issues/123346 + @Deprecated('This getter is temporary and will be removed shortly.') + static Iterable get doNotUseWillBeDeletedWithoutWarningKeys => values.keys; + @override String toString() { switch (index) {