Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0.0-pre.1]Using Style(before: "!") will raise error #258

Closed
canisterism opened this issue Apr 8, 2020 · 3 comments
Closed

[1.0.0-pre.1]Using Style(before: "!") will raise error #258

canisterism opened this issue Apr 8, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@canisterism
Copy link

Hi, I really like this package and thank you committers to create such great package.
Here I report unexpected behavior that seems a bug.

Environment

  • flutter_html: ^1.0.0-pre.1
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.5 18F132, locale en-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.43.2)
[✓] Connected device (1 available)

• No issues found!

Steps to reproduce

Here's code to reproduce.

Html(
  data: '<span class="another-bullet-point">aaa</span>',
  style: {
    ".another-bullet-point": Style(after: "!"),
  }
)

Expected Result

I wanted to alternate <li>' s bullet point with before: "!".

(In the first place, I wanted to change bullet point of <li>, from to !, however it's not supported though)

So, I expected to show screen like below.

! aaa

Actual Result

App raises error. Here's track trace below.

════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building HtmlParser(dirty):
The getter 'height' was called on null.
Receiver: null
Tried calling: height

The relevant error-causing widget was
    Html 
lib/main.dart:92
When the exception was thrown, this was the stack
#0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:53:5)
#1      HtmlParser._collapseMargins 
package:flutter_html/html_parser.dart:505
#2      List.forEach  (dart:core-patch/growable_array.dart:285:8)
#3      HtmlParser._collapseMargins 
package:flutter_html/html_parser.dart:512
#4      List.forEach  (dart:core-patch/growable_array.dart:285:8)

Visual Proof (screenshots, videos, text)

Screenshot when exception raises:
image

screen:
image

@Sub6Resources Sub6Resources added the bug Something isn't working label Apr 15, 2020
@Sub6Resources
Copy link
Owner

Thank you. This is a very helpful error report. We will work on fixing this.

@canisterism
Copy link
Author

Thank you for response. I'm looking forward to fixing it!

@ryan-berger
Copy link
Collaborator

@canisterism This issue should be fixed if you upgrade to v1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants