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

RichText/WidgetSpan in a SliverList error on Flutter Web #211

Closed
bruckmatthew opened this issue Jan 11, 2020 · 1 comment
Closed

RichText/WidgetSpan in a SliverList error on Flutter Web #211

bruckmatthew opened this issue Jan 11, 2020 · 1 comment

Comments

@bruckmatthew
Copy link

bruckmatthew commented Jan 11, 2020

Think this issue maybe related to the flutter master channel, related to this issue flutter/#42086

My code

SliverList(
  delegate: SliverChildListDelegate([
    Html(
      data: welcomeContentHtml,
      onLinkTap: (url) {
        print("Opening $url...");
      },
    ),
 ])

I am also parsing in html text that's been previously parsed from Markdown using the markdown library (2.1.3). I suspect this is not related though.
String welcomeContentHtml = markdownToHtml("""Markdown text""");

Error log

> ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY
> ╞═════════════════════════════════════════════════════════
> The following NoSuchMethodError was thrown during performLayout():
> '<Unexpected Null Value>'
> method not found
> Receiver: null
> Arguments: []
> 
> The relevant error-causing widget was:
> RichText org-dartlang-app:///packages/flutter_html/html_parser.dart:693:11

and

The following RenderObject was being processed when the exception was fired: RenderParagraph#e1d8erelayoutBoundary=up7 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE:
creator: RichText ← Align ← DecoratedBox ← Padding ← Container ← ContainerSpan ← RichText ← Align
←
DecoratedBox ← Container ← ContainerSpan ← RichText ← ⋯
parentData: offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=956.0, 0.0<=h<=Infinity)
size: MISSING
textAlign: start
textDirection: ltr
softWrap: wrapping at box width
overflow: clip
locale: en_US
maxLines: unlimited
This RenderObject had the following descendants (showing up to depth 5):
text: TextSpan
WidgetSpan#1b361

I wrapped the Html widget in a sizedbox with defined height with no change.
Same error on both 0.11.1 and 1.0.0-pre.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants