flutter_html icon indicating copy to clipboard operation
flutter_html copied to clipboard

[BUG] Cannot build after adding flutter_html

Open MariuszJendrzejczak opened this issue 2 years ago • 5 comments

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)?'.

  • 'TapDownDetails' is from 'package:flutter/src/gestures/tap.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/gestures/tap.dart'). tap.dart:1

  • 'TapDragDownDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart'). tap_and_drag_gestures.dart:1 onTapDown: onTapDown, ^ /C:/Users/jendr/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:190:24: Error: The argument type 'void Function(TapUpDetails)' can't be assigned to the parameter type 'void Function(TapDragUpDetails)?'.

  • 'TapUpDetails' is from 'package:flutter/src/gestures/tap.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/gestures/tap.dart'). tap.dart:1

  • 'TapDragUpDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart'). tap_and_drag_gestures.dart:1 onSingleTapUp: onSingleTapUp, ^ /C:/Users/jendr/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:195:26: Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'.

  • 'TapDownDetails' is from 'package:flutter/src/gestures/tap.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/gestures/tap.dart'). tap.dart:1

  • 'TapDragDownDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart'). tap_and_drag_gestures.dart:1 onDoubleTapDown: onDoubleTapDown, ^ /C:/Users/jendr/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:196:31: Error: The argument type 'void Function(DragStartDetails)' can't be assigned to the parameter type 'void Function(TapDragStartDetails)?'.

  • 'DragStartDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart'). drag_details.dart:1

  • 'TapDragStartDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart'). tap_and_drag_gestures.dart:1 onDragSelectionStart: onDragSelectionStart, ^ /C:/Users/jendr/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:197:32: Error: The argument type 'void Function(DragStartDetails, DragUpdateDetails)' can't be assigned to the parameter type 'void Function(TapDragUpdateDetails)?'.

  • 'DragStartDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart'). drag_details.dart:1

  • 'DragUpdateDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart'). drag_details.dart:1

  • 'TapDragUpdateDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart'). tap_and_drag_gestures.dart:1 onDragSelectionUpdate: onDragSelectionUpdate,

                             ^
    

/C:/Users/jendr/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:198:29: Error: The argument type 'void Function(DragEndDetails)' can't be assigned to the parameter type 'void Function(TapDragEndDetails)?'.

  • 'DragEndDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart'). drag_details.dart:1

  • 'TapDragEndDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart'). tap_and_drag_gestures.dart:1 onDragSelectionEnd: onDragSelectionEnd, ^ /C:/Users/jendr/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:82:55: Error: A value of type 'RenderObject?' can't be assigned to a variable of type 'AbstractNode?'.

  • 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/rendering/object.dart'). object.dart:1

  • 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/E:/scr/flutter/flutter/packages/flutter/lib/src/foundation/node.dart'). node.dart:1 final AbstractNode? targetParent = renderObject.parent; ^

MariuszJendrzejczak avatar Sep 05 '23 10:09 MariuszJendrzejczak

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

erickok avatar Sep 05 '23 10:09 erickok

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

MariuszJendrzejczak avatar Sep 20 '23 18:09 MariuszJendrzejczak

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

emaborsa avatar Oct 10 '23 13:10 emaborsa

same problem use beta v2

AbishekPerera avatar Oct 30 '23 09:10 AbishekPerera

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

image

shinayser avatar Nov 16 '23 18:11 shinayser