Skip to content

Commit a3cba1b

Browse files
a-wallenschwa423
authored andcommitted
Revert "Remove deprecated calls to updateSemantics in PlatformDispatcher (flutter#36673)" (flutter#37388)
This reverts commit 4d8f07b.
1 parent 71f9d70 commit a3cba1b

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

lib/ui/platform_dispatcher.dart

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,27 @@ class PlatformDispatcher {
750750
_invoke(onAccessibilityFeaturesChanged, _onAccessibilityFeaturesChangedZone,);
751751
}
752752

753+
/// Change the retained semantics data about this platform dispatcher.
754+
///
755+
/// If [semanticsEnabled] is true, the user has requested that this function
756+
/// be called whenever the semantic content of this platform dispatcher
757+
/// changes.
758+
///
759+
/// In either case, this function disposes the given update, which means the
760+
/// semantics update cannot be used further.
761+
@Deprecated('''
762+
In a multi-view world, the platform dispatcher can no longer provide apis
763+
to update semantics since each view will host its own semantics tree.
764+
765+
Semantics updates must be passed to an individual [FlutterView]. To update
766+
semantics, use PlatformDispatcher.instance.views to get a [FlutterView] and
767+
call `updateSemantics`.
768+
''')
769+
void updateSemantics(SemanticsUpdate update) => _updateSemantics(update);
770+
771+
@FfiNative<Void Function(Pointer<Void>)>('PlatformConfigurationNativeApi::UpdateSemantics')
772+
external static void _updateSemantics(SemanticsUpdate update);
773+
753774
/// The system-reported default locale of the device.
754775
///
755776
/// This establishes the language and formatting conventions that application

lib/web_ui/lib/platform_dispatcher.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ abstract class PlatformDispatcher {
8383
VoidCallback? get onAccessibilityFeaturesChanged;
8484
set onAccessibilityFeaturesChanged(VoidCallback? callback);
8585

86+
@Deprecated('''
87+
In a multi-view world, the platform dispatcher can no longer provide apis
88+
to update semantics since each view will host its own semantics tree.
89+
90+
Semantics updates must be passed to an individual [FlutterView]. To update
91+
semantics, use PlatformDispatcher.instance.views to get a [FlutterView] and
92+
call `updateSemantics`.
93+
''')
8694
void updateSemantics(SemanticsUpdate update);
8795

8896
Locale get locale;

lib/web_ui/lib/src/engine/platform_dispatcher.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,22 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
690690
_onAccessibilityFeaturesChanged, _onAccessibilityFeaturesChangedZone);
691691
}
692692

693+
/// Change the retained semantics data about this window.
694+
///
695+
/// If [semanticsEnabled] is true, the user has requested that this function
696+
/// be called whenever the semantic content of this window changes.
697+
///
698+
/// In either case, this function disposes the given update, which means the
699+
/// semantics update cannot be used further.
693700
@override
701+
@Deprecated('''
702+
In a multi-view world, the platform dispatcher can no longer provide apis
703+
to update semantics since each view will host its own semantics tree.
704+
705+
Semantics updates must be passed to an individual [FlutterView]. To update
706+
semantics, use PlatformDispatcher.instance.views to get a [FlutterView] and
707+
call `updateSemantics`.
708+
''')
694709
void updateSemantics(ui.SemanticsUpdate update) {
695710
EngineSemanticsOwner.instance.updateSemantics(update);
696711
}

0 commit comments

Comments
 (0)