English 中文(简体)
• 如何转换冲碎——网络——对HtmlElement的看法 对网络模式的看法
原标题:How to convert flutter_web_view to HtmlElementView on web mode

This may be a duplicate question as I have seen a lot of questions that has to do with iframes, webview and all that but each one gets me more confused as I study them. Currently I am making use of the WebView widget to display a webview in my mobile app. I wish to build for the web now but WebView is not supported for web so I have been seeking for an alternative approach. I got to know about HtmlElementView from the flutter documentation. Trying to research into it but I can not seem to find any clear way I am supposed to use it to solve my problem.

我的守则是:

    Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Container(
          margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
          child: !kIsWeb
              ? WebView(
                  initialUrl: this.widget._url,
                  javascriptMode: JavascriptMode.unrestricted,
                  onPageStarted: this._pageStarted,
                )
              : HtmlElementView(
                  viewType:   ,
                ),
        ),
      ),
    );
  }

根据我的代码,我正在建立<代码>WebView,因为没有为网站和大楼编辑<代码>。 浏览。 就我所怀的仇恨来说,这在我所知的今天可以 go在<条码>上。 HtmlElementView。 从《指南》中,是用我并不真正知道的任何东西的《指令》。

我想做的是什么? 载于WebView的内容是动态的类型,因此我希望在<代码>上填满。 HtmlElementView。 如果能帮助我这样做的话,那么我会非常赞赏任何帮助或可能帮助我的材料。 感谢。

问题回答

I m目前处于同样的追求之中,并找到了这个简单的例子:

https://codepen.io/riccio85/pen/wvMeaMe

import  dart:html ;
import  dart:ui  as ui;
import  package:flutter/material.dart ;

void main() {
  // ignore: undefined_prefixed_name
  ui.platformViewRegistry.registerViewFactory(
       hello-html ,
      (int viewId) => IFrameElement()
        ..width =  500 
        ..height =  360 
        ..src =  https://www.youtube.com/embed/xg4S67ZvsRs 
        ..style.border =  none );

  runApp( Padding(
        padding: EdgeInsets.all(25),
        child: SizedBox(
          width: 640,
          height: 360,
          child: HtmlElementView(viewType:  hello-html ),
      ),
    ),
  );
}

它不是完美的,而是似乎做我需要做的事情。 我要说的是,我最后以与你的榜样相同的方式对网站进行检查,并以其他方式使用<代码>webview_flutter。

各位希望局势有所改善。

您可以使用,而不是听命。





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签