Skip to content

Instantly share code, notes, and snippets.

@ziyadElon
Created June 29, 2019 09:49
Show Gist options
  • Save ziyadElon/b10579f5d80f469c4d4c22a1fe454ccd to your computer and use it in GitHub Desktop.
Save ziyadElon/b10579f5d80f469c4d4c22a1fe454ccd to your computer and use it in GitHub Desktop.
Flutter Web Article Support Gist
import 'dart:html';
import 'package:flutter_web_ui/ui.dart' as ui;
import 'package:flutter_web/material.dart';
void main() {
ui.platformViewRegistry.registerViewFactory(
'video',
(int viewId) => VideoElement()..src = 'some-url'
);
runApp(Directionality(
textDirection: TextDirection.ltr,
child: HtmlView(viewType: 'video'),
));
}
@joprice
Copy link

joprice commented Jul 10, 2019

Is it possible to modify the src attribute after based on user input?

@ziyadElon
Copy link
Author

I think we can achieve that if we wrap the HtmlView inside a StatefulWidget

@ThinkDigitalSoftware
Copy link

ThinkDigitalSoftware commented Nov 14, 2019

What package does this HtmlView come from?
I can't find flutter_web_ui

@recvec
Copy link

recvec commented Dec 5, 2019

What package does this HtmlView come from?
I can't find flutter_web_ui

Try HtmlElementView

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment