Skip to content

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

@bruckmatthew

Description

@bruckmatthew

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions