Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] Project update #479

Open
vadrian89 opened this issue Dec 13, 2023 · 11 comments
Open

[QUESTION] Project update #479

vadrian89 opened this issue Dec 13, 2023 · 11 comments
Labels
question Further information is requested

Comments

@vadrian89
Copy link

vadrian89 commented Dec 13, 2023

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:

  • Refactor the code in a more readable and maintainable format.
  • Enable support for desktop. Currently flutter_inappwebview package does not support desktop, so we can't add it to editor.
  • Try and find a solution to focus issues.

Afterwards I want to help:

Since this is your repo, I have a few questions:

  • Do you accept PRs? Are you still active on this repo?
  • Anything I should be aware of? Such as: do's and dont's, stuff I should avoid breaking, etc.
  • Can I ask more questions if there is something I don't understand?
@vadrian89 vadrian89 added the question Further information is requested label Dec 13, 2023
@graemep-nz
Copy link

@tneotia

@vadrian89
Copy link
Author

vadrian89 commented Dec 24, 2023

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),
                  ),
                );
              },
            )

image

@graemep-nz
Copy link

print the values of maxWidth and maxHeight - they're probably infinity,

@vadrian89
Copy link
Author

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

@graemep-nz
Copy link

I don't know what HtmlElementView is. What happens if you do this
return SizedBox(
height: height - 100,
width: width - 100,

@vadrian89
Copy link
Author

It resized the box accordingly, but the editor keeps it's size.

image

@graemep-nz
Copy link

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.

@vadrian89
Copy link
Author

vadrian89 commented Dec 24, 2023

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.

@vadrian89
Copy link
Author

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

@azeunkn0wn
Copy link

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.

@tneotia
Copy link
Owner

tneotia commented May 18, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants