Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Deprecate platform_dispatcher apis in favor of updateSemantics in F…
…lutterView
  • Loading branch information
a-wallen committed Oct 28, 2022
commit 747af49bde03d73a1bd02d7798fabe619148e6f8
31 changes: 26 additions & 5 deletions lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,14 @@ abstract class FlutterView {
@FfiNative<Void Function(Pointer<Void>)>('PlatformConfigurationNativeApi::Render')
external static void _render(Scene scene);

/// Change the retained semantics data about this [FlutterView].
/// Change the retained semantics data about this platform dispatcher.
///
/// If [PlatformDispatcher.semanticsEnabled] is true, the user has requested that this function
/// be called whenever the semantic content of this [FlutterView]
/// If [semanticsEnabled] is true, the user has requested that this function
/// be called whenever the semantic content of this platform dispatcher
/// changes.
///
/// This function disposes the given update, which means the semantics update
/// cannot be used further.
/// In either case, this function disposes the given update, which means the
/// semantics update cannot be used further.
void updateSemantics(SemanticsUpdate update) => _updateSemantics(update);

@FfiNative<Void Function(Pointer<Void>)>('PlatformConfigurationNativeApi::UpdateSemantics')
Expand Down Expand Up @@ -734,6 +734,27 @@ class SingletonFlutterWindow extends FlutterWindow {
platformDispatcher.onAccessibilityFeaturesChanged = callback;
}

<<<<<<< HEAD
=======
/// Change the retained semantics data about this window.
///
/// {@macro dart.ui.window.functionForwardWarning}
///
/// 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('''
A singleton flutter window no longer manages semantics trees. In a multi-view
world, each flutter view must manage its own semantics tree.

Call updateSemantics() from FlutterView instead.
''')
void updateSemantics(SemanticsUpdate update) => platformDispatcher.updateSemantics(update);

>>>>>>> ccc5c13a67 (Deprecate `platform_dispatcher` apis in favor of updateSemantics in FlutterView)
/// Sends a message to a platform-specific plugin.
///
/// {@macro dart.ui.window.functionForwardWarning}
Expand Down
9 changes: 9 additions & 0 deletions lib/web_ui/lib/src/engine/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,21 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
/// semantics update cannot be used further.
@override
@Deprecated('''
<<<<<<< HEAD
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`.
=======
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 flutter view. To update
semantics, use PlatformDispatcher.instance.views to get a flutter view and
call `updateSemantics`.
>>>>>>> ccc5c13a67 (Deprecate `platform_dispatcher` apis in favor of updateSemantics in FlutterView)
''')
void updateSemantics(ui.SemanticsUpdate update) {
EngineSemanticsOwner.instance.updateSemantics(update);
Expand Down