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.8k stars 874 forks source link

[BUG] flutter_math_fork dependency on package launch error with Flutter v3.10.0 #1268

Closed athmora closed 1 year ago

athmora commented 1 year ago

Describe the bug: The app just don't run. LogCat below is more detailed, but it seems to me that the problem is related with the flutter_math_fork 0.5.0 package dependency on flutter_html. The App runs perfect in Flutter 3.7.12 but with the upgrade just not. A lot of things i comment in this post can be ignored, just please upgrade the dependency into the package, so many people has this error on Flutter >= 3.10.0, flutter_math_fork has a new version (0.7.0) and they fix the Dart 3.0.0 compatibility error.

HTML to reproduce the issue: That is not the problem, the package usage is so basic, literally Html widget with a content and style map.

Html(
   data: [here there is a variable with the content],
   style: {
      "body": Style(
         fontFamily: 'OpenSans', // obviusly loaded.
         fontSize: const FontSize(16.0),
         lineHeight: const LineHeight(1.4),
         color: greyJet, // color variable.
          maxLines: 255,
      ),
   },
),

Html widget configuration:

Expected behavior: Just run the app.

Screenshots:

Device details and Flutter/Dart/flutter_html versions: Flutter 3.10.0 Dart 3.0.0 flutter_html version: ^2.2.1

Stacktrace/Logcat

onDragSelectionStart: onDragSelectionStart,
                              ^
: Error: The argument type 'void Function(DragStartDetails, DragUpdateDetails)' can't be assigned to the parameter type 'void Function(TapDragUpdateDetails)?'.
gesture_detector_builder.dart:197
- 'DragStartDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/C:/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
drag_details.dart:1
- 'DragUpdateDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/C:/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' ('/C:/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
tap_and_drag_gestures.dart:1
        onDragSelectionUpdate: onDragSelectionUpdate,
                               ^
: Error: The argument type 'void Function(DragEndDetails)' can't be assigned to the parameter type 'void Function(TapDragEndDetails)?'.
gesture_detector_builder.dart:198
- 'DragEndDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/C:/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' ('/C:/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
tap_and_drag_gestures.dart:1
        onDragSelectionEnd: onDragSelectionEnd,
                            ^
Failed to compile application.
Exited (sigterm)

Additional info: The debug console links to this file and shows where is the problem.

TextSelectionGestureDetector buildGestureDetector

Flutter doctor -v:

[√] Flutter (Channel stable, 3.10.0, on Microsoft Windows [Versi¢n 10.0.19045.2965], locale es-MX)
    • Flutter version 3.10.0 on channel stable at C:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 84a1e904f4 (7 days ago), 2023-05-09 07:41:44 -0700
    • Engine revision d44b5a94c9
    • Dart version 3.0.0
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\thoma\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_HOME = C:\Users\thoma\AppData\Local\Android\Sdk
    • ANDROID_SDK_ROOT = C:\Users\thoma\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Java\jdk-11\bin\java
    • Java version Java(TM) SE Runtime Environment 18.9 (build 11.0.18+9-LTS-195)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.26)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.33529.622
    • Windows 10 SDK version 10.0.19041.0
    X The current Visual Studio installation is incomplete. Please reinstall Visual Studio.

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] VS Code (version 1.77.3)
    • VS Code at C:\Users\thoma\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.64.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Versi¢n 10.0.19045.2965]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 113.0.5672.93
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 113.0.1774.35

[√] Network resources
    • All expected network resources are available.

It seems like the problem is related with the flutter_math_fork 0.5.0 package dependency on flutter_html.

A picture of a cute animal (not mandatory but encouraged) Meet Watson: https://drive.google.com/file/d/1ptNtFwDBmLUGCrF9125cAM0MfOerFuu3/view?usp=drivesdk

Chemeindefer commented 1 year ago

Same problem