-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[web] No implicit view in multi-view mode #48505
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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; | ||
} | ||
|
||
|
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. | ||
|
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!