I've embedded flutter web app in my website using Iframe. On website I've a simple text area and in flutter web app I've also a text widget. The functionality I want is that when I write something in this text area it should also show in my flutter web app instantly. Currently I'm doing it by passing url parameter to the src attribute of iframe. But it is very slow as it restart my flutter web app. The problem is not about embedding flutter web app into website. My problem is that how can we change data of flutter web app through browser.The functionality I want to achieve with speed
I don't want to do it like the following code by passing url parameter as it is very slow.
<!DOCTYPE html>
<html>
<body>
<input id='input' type="text">
<input type="button" onclick="changeText()" value="Change" />
<h1>The web application that is embeding flutter app</h1>
<div id = 'main'>
<div>
<iframe src="http://localhost:54827/#/" width="800px" height="600px"
style="overflow:auto;border:5px ridge blue"> </iframe>
</div>
</div>
</body>
<script>
var changeText = ()=>{
var textToDisplay = document.getElementById("input").value;
var frame = document.createElement('iframe');
frame.setAttribute('src', `http://localhost:55035/#/?answer=${textToDisplay}`);
frame.setAttribute('height', '600')
var main = document.getElementById("main");
main.innerHTML ='';
document.getElementById("main").appendChild(frame);
}
</script>
</html>