File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -844,6 +844,8 @@ class WebFController {
844
844
UriParser ? uriParser;
845
845
WebFLoadingMode mode = WebFLoadingMode .standard;
846
846
847
+ bool get isPreLoadingOrPreRenderingComplete => preloadStatus == PreloadingStatus .done || preRenderingStatus == PreRenderingStatus .done;
848
+
847
849
static WebFController ? getControllerOfJSContextId (double ? contextId) {
848
850
if (! _controllerMap.containsKey (contextId)) {
849
851
return null ;
Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ abstract class WidgetElement extends dom.Element {
31
31
return _state! .context;
32
32
}
33
33
34
- WidgetElement (
35
- BindingContext ? context) : super (context) {
34
+ WidgetElement (BindingContext ? context) : super (context) {
36
35
WidgetsFlutterBinding .ensureInitialized ();
37
36
_widget = WebFWidgetElementStatefulWidget (this );
38
37
}
@@ -207,7 +206,7 @@ abstract class WidgetElement extends dom.Element {
207
206
static dom.Node ? _getAncestorWidgetNode (WidgetElement element) {
208
207
dom.Node ? parent = element.parentNode;
209
208
210
- while (parent != null ) {
209
+ while (parent != null ) {
211
210
if (parent.flutterWidget != null ) {
212
211
return parent;
213
212
}
@@ -224,7 +223,8 @@ abstract class WidgetElement extends dom.Element {
224
223
dom.Node ? ancestorWidgetNode = _getAncestorWidgetNode (this );
225
224
if (ancestorWidgetNode != null ) {
226
225
(ancestorWidgetNode as dom.Element ).flutterWidgetState! .addWidgetChild (attachedAdapter! );
227
- } else if (ownerDocument.controller.mode == WebFLoadingMode .standard) {
226
+ } else if (ownerDocument.controller.mode == WebFLoadingMode .standard ||
227
+ ownerDocument.controller.isPreLoadingOrPreRenderingComplete) {
228
228
ownerDocument.controller.onCustomElementAttached !(attachedAdapter! );
229
229
} else {
230
230
ownerDocument.controller.pendingWidgetElements.add (attachedAdapter! );
You can’t perform that action at this time.
0 commit comments