Skip to content

Error using ListView + Expandable Item + TextField #18276

@rmarau

Description

@rmarau

Using a ListView with variable size items (expandable) and a TextField input leads to:

flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building NotificationListener<KeepAliveNotification>:
flutter: 'package:flutter/src/rendering/object.dart': Failed assertion: line 2756 pos 14:
flutter: '_debugUltimatePreviousSiblingOf(after, equals: _firstChild)': is not true.

I'm using the beta branch v0.4.4 (tested with master as well).

To reproduce:
Follow this gist

  1. Tap an Item to expand.
  2. Tap the TextField to get focus
  3. Scroll down (3 strong swipes should be enough)
  4. Tap a random item to expand.
    You should be hitting the assertion, in debug mode. Running in release, the assertion is not verified but the list gets clipped at the top.

This might be related to #18063: Same assertion but a different context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions