Answers for "flutter show html for web"

1

flutter web show html

There is a HTMLElementView widget which can help you embed Html in 
flutter web. This widget can take an Iframe and render it. 

If you don't prefer Iframe then you can embed simply a BodyElement 
from the dart:html library directly.

An example of embedding Iframe is availabel here. Eventhough its from
an old repo, the code is valid and I couldn't find a latest one.

If you don't want do go the tough way, there is simplified widget from 
Rodydavis which is available here called easy_web_view.

Still if you need code sample a create simple dart pad and share the MRE,
Posted by: Guest on April-08-2021
1

flutter web load html

import 'dart:ui' as ui;
import 'dart:html';



ui.platformViewRegistry.registerViewFactory(
    'test-view-type',
    (int viewId) => IFrameElement()
      ..width = '640'
      ..height = '360'
      ..src = "https://www.youtube.com/embed/5VbAwhBBHsg"
      ..style.border = 'none');

//just an example if you know how to code then change then feel free to change the values
Posted by: Guest on May-10-2021

Browse Popular Code Answers by Language