Skip to content

ListView Builder scrolling is slow due to improper input events handling #22314

@kieferlam

Description

@kieferlam

The ListView Builder is slow compared to native apps. I've attached a video demo-ing my experience. And my complete code (which is basically just the example on the Working with long lists guide.

The gif has the flutter listview and also shows the scrolling of Reddit Is Fun app as well just for a reference.

gif

main.dart

import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      home: Scaffold(
        body: ListView.builder(
            key: Key("lvbuildertest"),
            itemCount: 200,
            itemBuilder: (context, index) {
              return ListTile(title: Text("index: $index"));
            }),
      ),
    );
  }
}
[√] Flutter (Channel master, v0.9.4-pre.31, on Microsoft Windows [Version 10.0.17134.285], locale en-GB)
    • Flutter version 0.9.4-pre.31 at F:\androidsdk\flutter
    • Framework revision 52697ef962 (11 hours ago), 2018-09-26 07:57:05 +0200
    • Engine revision 38a646e14c
    • Dart version 2.1.0-dev.5.0.flutter-4cf2d3990b

[√] Android toolchain - develop for Android devices (Android SDK 28.0.2)
    • Android SDK at F:\androidsdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    • All Android licenses accepted.

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\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-1024-b02)

[!] IntelliJ IDEA Ultimate Edition (version 2018.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.5
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[√] VS Code (version 1.27.2)
    • VS Code at C:\Users\username


\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 2.18.0

[√] Connected devices (1 available)
    • SM N9005 • 192.168.0.3:5555 • android-arm • Android 8.1.0 (API 27)

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: performanceRelates to speed or footprint issues (see "perf:" labels)f: scrollingViewports, list views, slivers, etc.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