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';
4
4
import 'package:flutter/material.dart' ;
5
5
import 'package:flutter_html/flutter_html.dart' ;
6
6
import '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;
9
8
10
9
import 'package:webview_flutter/webview_flutter.dart' ;
11
10
@@ -25,10 +24,10 @@ class IframeWidget extends StatelessWidget {
25
24
double .tryParse (extensionContext.attributes['width' ] ?? "" );
26
25
final givenHeight =
27
26
double .tryParse (extensionContext.attributes['height' ] ?? "" );
28
- final html. IFrameElement iframe = html. IFrameElement ()
27
+ final HTMLIFrameElement iframe = HTMLIFrameElement ()
29
28
..width = (givenWidth ?? (givenHeight ?? 150 ) * 2 ).toString ()
30
29
..height = (givenHeight ?? (givenWidth ?? 300 ) / 2 ).toString ()
31
- ..src = extensionContext.attributes['src' ]
30
+ ..src = extensionContext.attributes['src' ] ?? ""
32
31
..style.border = 'none' ;
33
32
final String createdViewId = _getRandString (10 );
34
33
ui.platformViewRegistry
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ dependencies:
12
12
sdk : flutter
13
13
html : ' >=0.15.0 <1.0.0'
14
14
flutter_html : ^3.0.0-beta.2
15
+ web : ' >=1.1.1 < 2.0.0'
15
16
webview_flutter : ' >=4.0.0 <5.0.0'
16
17
17
18
dev_dependencies :
You can’t perform that action at this time.
0 commit comments