Closed AceChen1 closed 1 year ago
Duplicate of #589
Duplicate of #589
oh? looks like this lib is also you created wo
Duplicate of #589
looks like the issue still no solution so far ?
looks like this lib is also you created wo
Haha no I didn't create it, but I am a contributor here.
looks like the issue still no solution so far ?
For now yes, the table rendering is quite tricky in Flutter, you can see we have tried to discuss solutions in that issue. Hopefully we can find something soon.
looks like this lib is also you created wo
Haha no I didn't create it, but I am a contributor here.
looks like the issue still no solution so far ?
For now yes, the table rendering is quite tricky in Flutter, you can see we have tried to discuss solutions in that issue. Hopefully we can find something soon.
I see, i just try your way, i found at least it will not cause error, may i know your guys new version will include this code? for us app meet this issue so far, need find a way to avoid the issue but don't want change the code on us local side...
bool hasTable = element?.parent?.localName == 'td';
return Container(
margin: style.margin,
padding: style.padding,
decoration: BoxDecoration(
color: style.backgroundColor,
border: style.border,
),
width: style.width,
height: style.height,
child: hasTable ? _layoutCells(context, null)
: LayoutBuilder(builder: (_, constraints) => _layoutCells(context, constraints)),
);
I see, i just try your way, i found at least it will not cause error, may i know your guys new version will include this code? for us app meet this issue so far, need find a way to avoid the issue but don't want change the code on us local side...
The problem with this is that if the table is nested inside other tag, like td > div > table
, then this will error once again. Of course this might be a quick fix for the common use case, but we shouldn't release this as a full fix because it does not work for all HTML. I suggest forking the package, adding this code, and making git dependency on this fork if you don't want to change locally.
I see, i just try your way, i found at least it will not cause error, may i know your guys new version will include this code? for us app meet this issue so far, need find a way to avoid the issue but don't want change the code on us local side...
The problem with this is that if the table is nested inside other tag, like
td > div > table
, then this will error once again. Of course this might be a quick fix for the common use case, but we shouldn't release this as a full fix because it does not work for all HTML. I suggest forking the package, adding this code, and making git dependency on this fork if you don't want to change locally.
i see, thanks.
@tneotia hi, may i know the master branch is the latest code? i just see the flutter pub, the latest version is 2.2.0, but looks like the master version is 2.1.5 (check from yaml file).
Master branch is normally latest but right now we are still waiting in the library owner to merge the 2.2.0 PR.
Master branch is normally latest but right now we are still waiting in the library owner to merge the 2.2.0 PR.
i see, Thanks your update.
bool hasTable = element?.parent?.localName == 'td'; return Container( margin: style.margin, padding: style.padding, decoration: BoxDecoration( color: style.backgroundColor, border: style.border, ), width: style.width, height: style.height, child: hasTable ? _layoutCells(context, null) : LayoutBuilder(builder: (_, constraints) => _layoutCells(context, constraints)), );
@AceChen1 @tneotia
If I also wanted to implement this solution, where am I supposed to place this code? Where does element
come from?
bool hasTable = element?.parent?.localName == 'td'; return Container( margin: style.margin, padding: style.padding, decoration: BoxDecoration( color: style.backgroundColor, border: style.border, ), width: style.width, height: style.height, child: hasTable ? _layoutCells(context, null) : LayoutBuilder(builder: (_, constraints) => _layoutCells(context, constraints)), );
@AceChen1 @tneotia If I also wanted to implement this solution, where am I supposed to place this code? Where does
element
come from?
@timmyrosen hi guys, please use this repo, Thanks. https://github.com/Jim-S-Chang/flutter_html
I understand why this is working for you (https://github.com/Jim-S-Chang/flutter_html/commit/dd25f9a1432b7cde56eed20e220c6b8546ad76c8) but it's too limited I'm afraid as it might not be the direct parent of the nested table that is a <td>
. I guess if we can search recursively though that it would be sufficient to support nested tables. I'll give it a shot.
@AceChen1 Hi brother, do you have an email I can hit you up on. I am trying to implement your fix in my code for a nested table and struggling a bit. I'd really appreciate it! danielgchap@hotmail.com Appreciate you!
@erickok @AceChen1 This is what I'm working with.. any thoughts...?
If I remove the
Thank you!
Closing this as it really is a duplicate of #589. See the discussion there for more info.
hi guys, if the html data like that:
looks like the lib will have issue, can help to give a suggestion if have those case ?