title: flutter web :How to find iframeElement to replace it's src
body: <p>I have a flutter project that i added web support to it. Now in my page i have 2 button.I want to when user clicked on each button, a web page shown.So in order to i create custom widget :</p>
  <pre><code>  @override
    Widget build(BuildContext context) {
      print(&quot;url is ------&gt; ${url}&quot;);
      isAddedElement();
      _iframeElement.height = double.maxFinite.toString();
      _iframeElement.width = double.maxFinite.toString();
      _iframeElement.src = url;
      _iframeElement.style.border = 'none';
      _iframeElement.id = 'iframe';
  
      ui.platformViewRegistry.registerViewFactory(
        'iframeElement',
        (int viewId) =&gt; _iframeElement,
      );
      _iframeWidget = HtmlElementView(
        // key: UniqueKey(),
        viewType: 'iframeElement',
      );
      return SizedBox(
        height: 600,
        width: 600,
        child: _iframeWidget,
      );
    }
  </code></pre>
  <p>in<code>isAddedElement</code> method i want to check <code>iframeElement.id = 'iframe'</code> is exist or not?If exist i want to change src with the new web page:</p>
  <pre><code>  bool isAddedElement() {
      IFrameElement frame = document.querySelector('iframe');
      if (frame != null) frame.src = url;
    }
  </code></pre>
  <p>but <code>document.querySelector('iframe')</code> always return null?</p>