Skip to content

Commit d972f6d

Browse files
committed
add fromElement constructor
1 parent 8a350cc commit d972f6d

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

lib/flutter_html.dart

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,29 @@ class Html extends StatelessWidget {
7373
Html.fromDom({
7474
Key? key,
7575
GlobalKey? anchorKey,
76-
@required this.document,
76+
@required dom.Document? document,
77+
this.onLinkTap,
78+
this.onAnchorTap,
79+
this.customRender = const {},
80+
this.customImageRenders = const {},
81+
this.onCssParseError,
82+
this.onImageError,
83+
this.onMathError,
84+
this.shrinkWrap = false,
85+
this.onImageTap,
86+
this.tagsList = const [],
87+
this.style = const {},
88+
this.navigationDelegateForIframe,
89+
}) : data = null,
90+
assert(document != null),
91+
this.document = document!.documentElement,
92+
_anchorKey = anchorKey ?? GlobalKey(),
93+
super(key: key);
94+
95+
Html.fromElement({
96+
Key? key,
97+
GlobalKey? anchorKey,
98+
this.document,
7799
this.onLinkTap,
78100
this.onAnchorTap,
79101
this.customRender = const {},

0 commit comments

Comments
 (0)