Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.8k stars 874 forks source link

Optional properties: selectable, placeholderAlignment. #1191

Closed darkstarx closed 1 year ago

darkstarx commented 2 years ago

To eliminate the issue of using this widget inside the IntrinsicHeight, we must temporary discard of using baseline alignment. This PR makes this property bottom by default and still allows to customize the value to keep the widget ready to use when the Flutter issue https://github.com/flutter/flutter/issues/65895 is solved (by configuring the placeholderAlignment property for specific tags in the style property). Also it makes the property selectable customizable as well.

TDuffinNTU commented 1 year ago

Can confirm the fix works on my project, at least to fix the layout issues :) I've noticed my table doesn't scroll (within its single child scroll view) which is another issue but I'll quickly confirm if that's on my end.

TDuffinNTU commented 1 year ago

Appears there are still some layout regressions with this fix, even though it does improve on laying out otherwise. Tables are now having large amounts of whitespace between columns instead of sizing themselves to match their content + padding. The scrolling behaviour also appears to be a regression, but oddly works slightly better if you add a scroll controller with an intialScrollOffset value.

I'll keep investigating but I think this is due to the lack of intrinsic width calculations of the columns with these changes.

husainazkas commented 1 year ago

This solve my issue👍 thanks @darkstarx

ElDuderini commented 1 year ago

I would love to see this pushed into the next alpha release. This issue in particular is what is preventing me from using the alpha releases of the HTML plugin.

fondoger commented 1 year ago

I tested this PR. It fixed the Intrinsic issue, and works pretty well. I would like to have it in the master branch, too.

darkstarx commented 1 year ago

Sorry, we're not changing all the subpackages to reference your fork of the project 😉.

I haven't had a chance to test the placeholderAlignment changes, but the requested changes need to be made before we can even consider merging.

If you're in charge of maintenance of this project, please, take an effort to do all of this changes you mentioned yourself in your repository to eliminate the bug. I won't remove anything from my fork since everything suits me in it.