File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -90,17 +90,13 @@ class ImageContentElement extends ReplacedElement {
90
90
}
91
91
}
92
92
93
- /// Create a webview controller and old src independent of [IframeContentElement]
94
- /// to make sure it doesn't reset when the html string is updated
95
- WebViewController controller;
96
- String oldUrl;
97
-
98
93
/// [IframeContentElement is a [ReplacedElement] with web content.
99
94
class IframeContentElement extends ReplacedElement {
100
95
final String src;
101
96
final double width;
102
97
final double height;
103
98
final NavigationDelegate navigationDelegate;
99
+ final GlobalKey key = GlobalKey ();
104
100
105
101
IframeContentElement ({
106
102
String name,
@@ -115,18 +111,12 @@ class IframeContentElement extends ReplacedElement {
115
111
@override
116
112
Widget toWidget (RenderContext context) {
117
113
final sandboxMode = attributes["sandbox" ];
118
- if (oldUrl != null && src != oldUrl && controller != null ) {
119
- controller.loadUrl (src);
120
- }
121
- oldUrl = src;
122
114
return Container (
123
115
width: width ?? (height ?? 150 ) * 2 ,
124
116
height: height ?? (width ?? 300 ) / 2 ,
125
117
child: WebView (
126
118
initialUrl: src,
127
- onWebViewCreated: (WebViewController webController) {
128
- controller = webController;
129
- },
119
+ key: key,
130
120
javascriptMode: sandboxMode == null || sandboxMode == "allow-scripts"
131
121
? JavascriptMode .unrestricted
132
122
: JavascriptMode .disabled,
You can’t perform that action at this time.
0 commit comments