-
-
Notifications
You must be signed in to change notification settings - Fork 911
Open
Labels
<iframe>Issues with the <iframe> tagIssues with the <iframe> tagenhancementNew feature or requestNew feature or request
Milestone
Description
Describe your feature request
I see that flutter_html_iframe tries to parse width and height but fails when it contains "%".
I think this kind of width and height values can use MediaQuery.of(context.buildContext).size.height
or width.
Here's my "not so clean at the moment" solution for it.
final num? isPercentWidthValue =
context.tree.element?.attributes['width']?.contains('%') ?? false
? double.tryParse(context.tree.element?.attributes['width']!
.replaceAll('%', '') ??
'')
: null;
return Container(
width: isPercentWidthValue != null
? MediaQuery.of(context.buildContext).size.width *
isPercentWidthValue /
100
: givenWidth ?? (givenHeight ?? 150) * 2,
...
Let me know what you guys think.
Additional context
Metadata
Metadata
Assignees
Labels
<iframe>Issues with the <iframe> tagIssues with the <iframe> tagenhancementNew feature or requestNew feature or request
Projects
Status
Todo