Skip to content

Add ExpansionTile.builder ? ExpansionTile Performance Issue #40752

Closed

Description

ExpansionTile needs a (.builder constructor) just like listview
if expansion tile have lots of heavy children it causes hard fps drop

[√] Flutter (Channel stable, v1.9.1+hotfix.2, on Microsoft Windows [Version 10.0.17763.678], locale en-US)
    • Flutter version 1.9.1+hotfix.2 at C:\flutter
    • Framework revision 2d2a1ffec9 (11 days ago), 2019-09-06 18:39:49 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at C:\Users\Kirolous.nashaat\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • ANDROID_HOME = C:\Users\Kirolous.nashaat\AppData\Local\Android\Sdk
    • Java binary at: D:\Sources\android-studio-ide-181.4987877-windows\android-studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[!] Android Studio (version 3.2)
    • Android Studio at D:\Sources\android-studio-ide-181.4987877-windows\android-studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[√] IntelliJ IDEA Community Edition (version 2019.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1.1
    • Flutter plugin version 39.0.5
    • Dart plugin version 192.6603.23

[√] Connected device (1 available)
    • Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 9 (API 28) (emulator)

! Doctor found issues in 1 category.

Activity

  1. ghost added
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Sep 18, 2019
  2. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: new featureNothing broken; request for a new capability
    on Sep 18, 2019
  3. deisold commented on Dec 10, 2019

    @deisold

    on Flutter Web (Channel master, v1.13.1-pre.76) it stucks completely and the listview stops scrolling while cpu gets up to 100%.

    Would be nice to have this fixed.

  4. liyuqian commented on Oct 12, 2020

    @liyuqian
    Contributor

    Adding web label as the performance seems to be particularly bad on web. This doesn't seem to be a very complicated change so I'm adding it to "Framework Performance Opportunities" project.

  5. yjbanov commented on Oct 15, 2020

    @yjbanov
    Contributor

    We made some improvements in Q2 in scrollable content with lots of children. Is there a repro case we could look at?

  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 15, 2020
  7. jmagman commented on Nov 5, 2020

    @jmagman
    Member

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!

    Thanks for your contribution.

  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 20, 2020
  9. MatrixDev commented on Apr 8, 2021

    @MatrixDev

    I have the same issue. Which exact information do you need?
    Just create ListView with ExpansionTile which contains 1000+ heavy items and fps will stuck.
    Problem is that ExpansionTile, unlike ListView, is not lazy and loads all the items at once. It must load only visible items to have optimal performance.

        final Widget result = Offstage(
          child: TickerMode(
            child: Padding(
              padding: widget.childrenPadding ?? EdgeInsets.zero,
              child: Column(
                crossAxisAlignment: widget.expandedCrossAxisAlignment ?? CrossAxisAlignment.center,
                children: widget.children, // <<< this is what causes performance problems
              ),
            ),
            enabled: !closed,
          ),
          offstage: closed
        );

    In my case I have 3 ExpansionTile collapsed by default with 100+ items in each. First time displaying my screen takes a huge performance hit, same as each collapse/expand.

    IMHO to properly fix this issue ExpansionTile must cooperate with ListView very tightly to display only visible children.

  10. github-actions commented on Aug 3, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityc: performanceRelates to speed or footprint issues (see "perf:" labels)frameworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesplatform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions