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.75k stars 805 forks source link

[BUG] Cannot build after adding flutter_html #1368

Open MariuszJendrzejczak opened 8 months ago

MariuszJendrzejczak commented 8 months ago

Describe the bug: I add the plugin, then use a widget and try to build. Before adding the plugin everything works fine. I don't even need to use a widget, if I only place the import to flutter_html in any of my dart scripts, the problem happens.

There is not to much others plugins in the app: dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 intl: ^0.18.1 flutter_html: ^2.2.1

HTML to reproduce the issue: final htmlData = r"""

This is the link

  <h1>Header 1</h1>
  <h2>Header 2</h2>
  <h3>Header 3</h3>
  <h4>Header 4</h4>
  <h5>Header 5</h5>
  <h6>Header 6</h6>
  <h3>This is HTML page that we want to integrate with Flutter.</h3>
  """;

Html widget configuration: Html( data: htmlData, tagsList: Html.tags, style: { "table": Style( backgroundColor: Color.fromARGB(0x50, 0xee, 0xee, 0xee), ), "tr": Style( border: Border(bottom: BorderSide(color: Colors.grey)), ), "th": Style( padding: EdgeInsets.all(6), backgroundColor: Colors.grey, ), "td": Style( padding: EdgeInsets.all(6), alignment: Alignment.topLeft, ), 'h5': Style(maxLines: 2, textOverflow: TextOverflow.ellipsis), }, ),

Expected behavior: App runs

Device details and Flutter/Dart/flutter_html versions: Pixel 5 API 31 (android-x64 emulator)

Stacktrace/Logcat Launching lib\main.dart on sdk gphone64 x86 64 in debug mode... main.dart:1 /C:/Users/jendr/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:186:20: Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'.

erickok commented 8 months ago

flutter_html 2.2.1 is really old; you might have to use the 3.0.0-beta.2, see https://pub.dev/packages/flutter_html/versions/3.0.0-beta.2

MariuszJendrzejczak commented 8 months ago

yep. v. 3.0.0-beta.2 solve it.

emaborsa commented 7 months ago

Same problem here. I cannot upgrade to 3.x.x until the bugs are removed.

AbishekPerera commented 6 months ago

same problem use beta v2

shinayser commented 6 months ago

Can't upgrade to flutter 3.13.9 using beta.2 due to flutter_html using an old version of flutter_layout_grid:

image