daohoangson / flutter_widget_from_html

Flutter package to render html as widgets that supports hyperlink, image, audio, video, iframe and many other tags.
https://pub.dev/packages/flutter_widget_from_html
MIT License
641 stars 241 forks source link

Details tag with SelectableTextFactory not tapable #810

Closed iska9der closed 1 year ago

iska9der commented 2 years ago

Steps to Reproduce

Packages

HTML ```
~/Oryx/src/fpga/.gitignore
# Always ignore journal and log files\n*.log\n*.jou\n*.str\n\n# Ignore trash in bd directory except .BD files\n/bd/**/*\n!/bd/**/*.bd\n\n# Ignore editor's temporary files\n*~\n*#\n\n# Ignore sendboxes\n/prj*/\n\n# Ignore Vivado temporary files\n.Xil/


</details>

<details>
  <summary>`HtmlWidget` configuration</summary>

HtmlWidget( textHtml, renderMode: RenderMode.sliverList, onTapUrl: (url) async => await getIt.get().launcher.launchUrl(url), onLoadingBuilder: (ctx, el, prgrs) => const CircleIndicator.small(), factoryBuilder: () => CustomFactory(context), customStylesBuilder: ((element) { if (element.localName == 'div' && element.parent == null) { return {'margin-left': '20px', 'margin-right': '20px'}; }

    return null;
  }),
  customWidgetBuilder: (element) {
    if (element.localName == 'img') {
      String imgSrc =
          element.attributes['data-src'] ?? element.attributes['src'] ?? '';

      if (imgSrc.isEmpty) {
        return null;
      }

      String imgExt = p.extension(imgSrc);

      if (imgExt == '.svg') return null;

      return Align(
        child: NetworkImageWidget(url: imgSrc),
      );
    }

    return null;
  },
)
</details>

<details>
  <summary>Tesing environment</summary>

[√] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19042.1706], locale ru-RU) • Flutter version 3.0.5 at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (6 weeks ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at C:\Users\R00t\AppData\Local\Android\sdk • Platform android-33, build-tools 31.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted.

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

[X] Visual Studio - develop for Windows X Visual Studio not installed; this is necessary for Windows development. Download at https://visualstudio.microsoft.com/downloads/. Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2021.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 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.70.2) • VS Code at C:\Users\R00t\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.46.0

[√] Connected device (4 available) • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.1706] • Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.114 • Edge (web) • edge • web-javascript • Microsoft Edge 104.0.1293.63

[√] HTTP Host Availability • All required HTTP hosts are available


</details>

## Expected results

On tap on summary open details

https://user-images.githubusercontent.com/11888809/186492174-4c7f96c2-0d5e-4d42-9d3c-22954cbaa56a.mp4

## Actual results

Nothing happens

https://user-images.githubusercontent.com/11888809/186492088-34e93bb5-a1f3-4f24-a600-1e399c52b2ce.mp4
iska9der commented 2 years ago

any suggestions, please?

daohoangson commented 2 years ago

v0.9.0 has been released with proper support for Flutter 3.3 SelectionArea. Please try upgrading and see whether it works for you.