-
-
Notifications
You must be signed in to change notification settings - Fork 929
Expand file tree
/
Copy pathflutter_html_iframe.dart
More file actions
30 lines (24 loc) · 725 Bytes
/
flutter_html_iframe.dart
File metadata and controls
30 lines (24 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
library;
import 'package:flutter/widgets.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'iframe_unsupported.dart'
if (dart.library.io) 'iframe_mobile.dart'
if (dart.library.js_interop) 'iframe_web.dart';
class IframeHtmlExtension extends HtmlExtension {
final NavigationDelegate? navigationDelegate;
const IframeHtmlExtension({
this.navigationDelegate,
});
@override
Set<String> get supportedTags => {"iframe"};
@override
InlineSpan build(ExtensionContext context) {
return WidgetSpan(
child: IframeWidget(
extensionContext: context,
navigationDelegate: navigationDelegate,
),
);
}
}