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.79k stars 860 forks source link

How use extensions with table ? ^3.0.0-beta.1 #1291

Closed felixferr closed 1 year ago

felixferr commented 1 year ago

Type question here. How to adapt this code with the new parameter extension ? customRender: { "table": (context, child) { return SingleChildScrollView( scrollDirection: Axis.horizontal, child: (context.tree as TableLayoutElement).toWidget(context), ); }, }, A picture of a cute animal (not mandatory but encouraged)

Sub6Resources commented 1 year ago

See #1262. Here's the updated example:

extensions: [
  WrapTagExtension(
    tagsToWrap: {'table'},
    builder: (child) {
      return SingleChildScrollView(
        scrollDirection: Axis.horizontal,
        child: child,
      );
    }
  ),
],
felixferr commented 1 year ago

I already tried this example but this tell me The method 'WrapTagExtension' isn't defined for the type 'AppTextHtm

Sembauke commented 1 year ago

Yes, that is because it will be in the next beta @felixferr. Anyway @Sub6Resources any update on this?

Sub6Resources commented 1 year ago

3.0.0-beta.2 was just released, which includes the WrapTagExtension. Sorry for the delay!

felixferr commented 1 year ago

same error with the latest release 3.0.0-beta.2, it works fine with you ?

Sub6Resources commented 1 year ago

Yes it works fine for me. Maybe check your pubspec.lock or run a flutter clean and then a flutter pub get?

Sembauke commented 1 year ago

The WrapTagExtension does not seem to work as expected. The SingleChildScrollView does not seem to scroll the table. Could you confirm this issue @Sub6Resources

Sub6Resources commented 1 year ago

It's worked for me every time I've tried it. Can someone produce a minimal reproducible example of the issue?

XternalSoft commented 1 year ago

in beta2 I founded

TagWrapExtension not WrapTagExtension

lukeirvin commented 10 months ago

I'm facing this same issue. Any new updates related to this?