Open vadrian89 opened 7 months ago
@tneotia
Anyone has any ideea why is the editor seems larger than the parent widget? The height is given from LayoutBuilder and is set to: summernote editor, IFrameElement and set to a SizedBox containing the HtmlElementView.
LayoutBuilder(
builder: (context, constraints) {
final width = constraints.maxWidth;
final height = constraints.maxHeight;
_iframe.width = width.toString();
_iframe.height = height.toString();
_sendMessageToIframe("setHeight", height.toString());
return SizedBox(
height: height,
width: width,
child: Directionality(
textDirection: TextDirection.ltr,
child: HtmlElementView(viewType: _viewId),
),
);
},
)
print the values of maxWidth and maxHeight - they're probably infinity,
No, they are not, already tested that. Here are outputs:
Builder constraints: BoxConstraints(0.0<=w<=1888.0, 0.0<=h<=866.0)
Received toIframe message from parent: {"view":"1703407396787","type":"toIframe","method":"setHeight","value":"866"}
Setting height: 866
Received toIframe message from parent: {"view":"1703407396787","type":"toIframe","method":"setWidth","value":"1888"}
Setting width: 1888
Builder constraints: BoxConstraints(0.0<=w<=1557.0, 0.0<=h<=691.0)
Received toIframe message from parent: {"view":"1703407396787","type":"toIframe","method":"setHeight","value":"691"}
Setting height: 691
Received toIframe message from parent: {"view":"1703407396787","type":"toIframe","method":"setWidth","value":"1557"}
Setting width: 1557
I don't know what HtmlElementView is. What happens if you do this return SizedBox( height: height - 100, width: width - 100,
It resized the box accordingly, but the editor keeps it's size.
I'm not sure what you're doing. Maybe use flutter_widget_from_html (HtmlWidget) instead of the embedded thing. So is the idea of the embedded thing so the browser interprets the html meaning all tags etc. are supported. https://api.flutter.dev/flutter/widgets/HtmlElementView-class.html it says <The widget fills all available space, the parent of this object must provide bounded layout constraints.> Try ConstrainedBox instead of SizedBox.
The summernote status bar seems to be is the issue. It's taking aditional 10 px, I will disable it for now.
Update, apparently the issue was caused by padding from the summernote editor.
Since the owner of the repo didn't answer, I went ahead and made a new package to continue development there.
The package can be found at: https://pub.dev/packages/html_editor_plus While the repo: https://github.com/vadrian89/html-editor-plus
Since the owner of the repo didn't answer, I went ahead and made a new package to continue development there.
The package can be found at: https://pub.dev/packages/html_editor_plus While the repo: https://github.com/vadrian89/html-editor-plus
Thank you. I'll migrate to your package soon.
Hi, PRs are definitely accepted, only thing I ask is to make it easy as possible to review. PRs with mainly formatting changes become extremely difficult to review.
I am not as active but I try to take a look at my notifications every now and then so you can ask questions as well, no issues.
Hello, I was looking into the project because I want to help with it, as I am also using it in a project. What I want to do at the moment:
Enable support for desktop.Currently flutter_inappwebview package does not support desktop, so we can't add it to editor.Afterwards I want to help:
Since this is your repo, I have a few questions: