Open ZsoltFischer opened 1 year ago
I think there are some use cases where this is valid. It's not vanilla css
like we prefer, so it won't be enabled by default, but I'll see if there are some good options for an extension mechanism that makes this possible.
Before and after selectors should accept widgets
Currently the
before
selector can only be aString
but some applications may require simple widgets, like icons. I propose thebefore
parameter instyle.dart
to be replaced by a Widget or the class to be extended with an additionalbeforeWidget
parameter.Implementation example, going with the second suggestion (adding the extra beforeWidget parameter)
In
replaced_element.dart
create a WidgetContentElement class:And in
html_parser.dart/650
extend the_processBeforesAndAfters
method like:If you consider my suggestion but you deem my implementation poor, please reach out to me! I'm willing to dive deeper and help in a proper refactor. This workaround was just a quick solution for my project with a tight deadline :)
The same goes for the
after
selector as well of course!