@@ -6,7 +6,7 @@ import 'dart:async';
6
6
7
7
import 'package:ui/ui.dart' as ui;
8
8
9
- import '../engine.dart' show buildMode, registerHotRestartListener, renderer, window;
9
+ import '../engine.dart' show buildMode, renderer, window;
10
10
import 'browser_detection.dart' ;
11
11
import 'configuration.dart' ;
12
12
import 'dom.dart' ;
@@ -45,7 +45,7 @@ class FlutterViewEmbedder {
45
45
/// The hostElement is abstracted by an [EmbeddingStrategy] instance, which has
46
46
/// different behavior depending on the `hostElement` value:
47
47
///
48
- /// - A `null` `hostElement` will allow Flutter to take over the whole screen .
48
+ /// - A `null` `hostElement` will cause Flutter to take over the whole page .
49
49
/// - A non-`null` `hostElement` will render flutter inside that element.
50
50
FlutterViewEmbedder ({DomElement ? hostElement}) {
51
51
// Create an appropriate EmbeddingStrategy using its factory...
@@ -58,16 +58,9 @@ class FlutterViewEmbedder {
58
58
));
59
59
60
60
reset ();
61
-
62
- assert (() {
63
- // _embeddingStrategy needs to clean-up stuff in the page on hot restart.
64
- registerHotRestartListener (_embeddingStrategy.onHotRestart);
65
- return true ;
66
- }());
67
61
}
68
62
69
- /// The [_embeddingStrategy] abstracts all the DOM manipulations required to
70
- /// embed a Flutter app in the user-supplied `hostElement` .
63
+ /// Abstracts all the DOM manipulations required to embed a Flutter app in an user-supplied `hostElement` .
71
64
late EmbeddingStrategy _embeddingStrategy;
72
65
73
66
// The tag name for the root view of the flutter app (glass-pane)
@@ -147,7 +140,7 @@ class FlutterViewEmbedder {
147
140
148
141
// Initializes the embeddingStrategy so it can host a single-view Flutter app.
149
142
_embeddingStrategy.initialize (
150
- embedderMetadata : < String , String > {
143
+ hostElementAttributes : < String , String > {
151
144
'flt-renderer' : '${renderer .rendererTag } ($rendererSelection )' ,
152
145
'flt-build-mode' : buildMode,
153
146
// TODO(mdebbar): Disable spellcheck until changes in the framework and
@@ -247,6 +240,7 @@ class FlutterViewEmbedder {
247
240
/// size if the change is caused by a rotation.
248
241
void _metricsDidChange (ui.Size ? newSize) {
249
242
updateSemanticsScreenProperties ();
243
+ // TODO(dit): Do not computePhysicalSize twice, https://github.com/flutter/flutter/issues/117036
250
244
if (isMobile && ! window.isRotation () && textEditing.isEditing) {
251
245
window.computeOnScreenKeyboardInsets (true );
252
246
EnginePlatformDispatcher .instance.invokeOnMetricsChanged ();
0 commit comments