File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/flutter_html_iframe Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,7 @@ import 'dart:math';
44import 'package:flutter/material.dart' ;
55import 'package:flutter_html/flutter_html.dart' ;
66import 'package:flutter_html_iframe/shims/dart_ui.dart' as ui;
7- // ignore: avoid_web_libraries_in_flutter
8- import 'dart:html' as html;
7+ import 'package:web/web.dart' show HTMLIFrameElement;
98
109import 'package:webview_flutter/webview_flutter.dart' ;
1110
@@ -25,10 +24,10 @@ class IframeWidget extends StatelessWidget {
2524 double .tryParse (extensionContext.attributes['width' ] ?? "" );
2625 final givenHeight =
2726 double .tryParse (extensionContext.attributes['height' ] ?? "" );
28- final html. IFrameElement iframe = html. IFrameElement ()
27+ final HTMLIFrameElement iframe = HTMLIFrameElement ()
2928 ..width = (givenWidth ?? (givenHeight ?? 150 ) * 2 ).toString ()
3029 ..height = (givenHeight ?? (givenWidth ?? 300 ) / 2 ).toString ()
31- ..src = extensionContext.attributes['src' ]
30+ ..src = extensionContext.attributes['src' ] ?? ""
3231 ..style.border = 'none' ;
3332 final String createdViewId = _getRandString (10 );
3433 ui.platformViewRegistry
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ dependencies:
1212 sdk : flutter
1313 html : ' >=0.15.0 <1.0.0'
1414 flutter_html : ^3.0.0-beta.2
15+ web : ' >=1.1.1 < 2.0.0'
1516 webview_flutter : ' >=4.0.0 <5.0.0'
1617
1718dev_dependencies :
You can’t perform that action at this time.
0 commit comments