This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] No implicit view in multi-view mode #48505
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,8 +218,10 @@ Future<void> initializeEngineUi() async { | |
_initializationState = DebugEngineInitializationState.initializingUi; | ||
|
||
RawKeyboard.initialize(onMacOs: operatingSystem == OperatingSystem.macOs); | ||
ensureImplicitViewInitialized(hostElement: configuration.hostElement); | ||
ensureFlutterViewEmbedderInitialized(); | ||
if (!configuration.multiViewEnabled) { | ||
ensureImplicitViewInitialized(hostElement: configuration.hostElement); | ||
ensureFlutterViewEmbedderInitialized(); | ||
} | ||
Comment on lines
+221
to
+224
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's goooo! |
||
_initializationState = DebugEngineInitializationState.initialized; | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -500,10 +500,22 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher { | |
// TODO(a-wallen): As multi-window support expands, the pop call | ||
// will need to include the view ID. Right now only one view is | ||
// supported. | ||
implicitView!.browserHistory.exit().then((_) { | ||
// | ||
// TODO(mdebbar): What should we do in multi-view mode? | ||
// https://github.com/flutter/flutter/issues/139174 | ||
Comment on lines
+504
to
+505
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we CC a-wallen in the issue? I think both your comment and the one above are talking about the multi-window support. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @a-wallen :) |
||
if (implicitView != null) { | ||
implicitView!.browserHistory.exit().then((_) { | ||
replyToPlatformMessage( | ||
callback, | ||
jsonCodec.encodeSuccessEnvelope(true), | ||
); | ||
}); | ||
} else { | ||
replyToPlatformMessage( | ||
callback, jsonCodec.encodeSuccessEnvelope(true)); | ||
}); | ||
callback, | ||
jsonCodec.encodeSuccessEnvelope(true), | ||
); | ||
} | ||
return; | ||
case 'HapticFeedback.vibrate': | ||
final String? type = decoded.arguments as String?; | ||
|
@@ -588,7 +600,9 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher { | |
decoded.arguments as Map<dynamic, dynamic>; | ||
switch (decoded.method) { | ||
case 'activateSystemCursor': | ||
implicitView!.mouseCursor | ||
// TODO(mdebbar): This needs a view ID from the framework. | ||
// https://github.com/flutter/flutter/issues/137289 | ||
implicitView?.mouseCursor | ||
.activateSystemCursor(arguments.tryString('kind')); | ||
} | ||
return; | ||
|
@@ -628,14 +642,23 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher { | |
// TODO(a-wallen): As multi-window support expands, the navigation call | ||
// will need to include the view ID. Right now only one view is | ||
// supported. | ||
implicitView!.handleNavigationMessage(data).then((bool handled) { | ||
if (handled) { | ||
replyToPlatformMessage( | ||
callback, jsonCodec.encodeSuccessEnvelope(true)); | ||
} else { | ||
callback?.call(null); | ||
} | ||
}); | ||
// | ||
// TODO(mdebbar): What should we do in multi-view mode? | ||
// https://github.com/flutter/flutter/issues/139174 | ||
if (implicitView != null) { | ||
implicitView!.handleNavigationMessage(data).then((bool handled) { | ||
if (handled) { | ||
replyToPlatformMessage( | ||
callback, | ||
jsonCodec.encodeSuccessEnvelope(true), | ||
); | ||
} else { | ||
callback?.call(null); | ||
} | ||
}); | ||
} else { | ||
callback?.call(null); | ||
} | ||
|
||
// As soon as Flutter starts taking control of the app navigation, we | ||
// should reset _defaultRouteName to "/" so it doesn't have any | ||
|
@@ -1249,7 +1272,9 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher { | |
/// requests from the embedder. | ||
@override | ||
String get defaultRouteName { | ||
return _defaultRouteName ??= implicitView!.browserHistory.currentPath; | ||
// TODO(mdebbar): What should we do in multi-view mode? | ||
// https://github.com/flutter/flutter/issues/139174 | ||
return _defaultRouteName ??= implicitView?.browserHistory.currentPath ?? '/'; | ||
} | ||
|
||
/// Lazily initialized when the `defaultRouteName` getter is invoked. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh yes, I thought of making this change. Good call!