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

Revert "Remove deprecated calls to updateSemantics in PlatformDispatcher" #37388

Merged
merged 1 commit into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lib/ui/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,27 @@ class PlatformDispatcher {
_invoke(onAccessibilityFeaturesChanged, _onAccessibilityFeaturesChangedZone,);
}

/// Change the retained semantics data about this platform dispatcher.
///
/// If [semanticsEnabled] is true, the user has requested that this function
/// be called whenever the semantic content of this platform dispatcher
/// changes.
///
/// In either case, this function disposes the given update, which means the
/// semantics update cannot be used further.
@Deprecated('''
In a multi-view world, the platform dispatcher can no longer provide apis
to update semantics since each view will host its own semantics tree.

Semantics updates must be passed to an individual [FlutterView]. To update
semantics, use PlatformDispatcher.instance.views to get a [FlutterView] and
call `updateSemantics`.
''')
void updateSemantics(SemanticsUpdate update) => _updateSemantics(update);

@FfiNative<Void Function(Pointer<Void>)>('PlatformConfigurationNativeApi::UpdateSemantics')
external static void _updateSemantics(SemanticsUpdate update);

/// The system-reported default locale of the device.
///
/// This establishes the language and formatting conventions that application
Expand Down
8 changes: 8 additions & 0 deletions lib/web_ui/lib/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ abstract class PlatformDispatcher {
VoidCallback? get onAccessibilityFeaturesChanged;
set onAccessibilityFeaturesChanged(VoidCallback? callback);

@Deprecated('''
In a multi-view world, the platform dispatcher can no longer provide apis
to update semantics since each view will host its own semantics tree.

Semantics updates must be passed to an individual [FlutterView]. To update
semantics, use PlatformDispatcher.instance.views to get a [FlutterView] and
call `updateSemantics`.
''')
void updateSemantics(SemanticsUpdate update);

Locale get locale;
Expand Down
15 changes: 15 additions & 0 deletions lib/web_ui/lib/src/engine/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,22 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
_onAccessibilityFeaturesChanged, _onAccessibilityFeaturesChangedZone);
}

/// Change the retained semantics data about this window.
///
/// If [semanticsEnabled] is true, the user has requested that this function
/// be called whenever the semantic content of this window changes.
///
/// In either case, this function disposes the given update, which means the
/// semantics update cannot be used further.
@override
@Deprecated('''
In a multi-view world, the platform dispatcher can no longer provide apis
to update semantics since each view will host its own semantics tree.

Semantics updates must be passed to an individual [FlutterView]. To update
semantics, use PlatformDispatcher.instance.views to get a [FlutterView] and
call `updateSemantics`.
''')
void updateSemantics(ui.SemanticsUpdate update) {
EngineSemanticsOwner.instance.updateSemantics(update);
}
Expand Down