Skip to content

NestedScrollView + ListView not work touchpad scroll #117316

@afl-dev

Description

@afl-dev

NestedScrollView + ListView not work touchpad scroll

if the application has a height equal to 0.8 of the screen height, then the touchpad scroll does not work
if we reduce the window size to about 0.5 screen height the touchpad scroll works

desktop macOS
master or stable
Flutter 3.7.0-10.0.pre.46 • channel master •
https://github.com/flutter/flutter.git
Framework • revision 420c6d6 (89 minutes ago) • 2022-12-19 08:44:36 -0500
Engine • revision 58ab5277a7
Tools • Dart 3.0.0 (build 3.0.0-35.0.dev) • DevTools 2.20.0

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: NestedScrollView(
        body: ListView(children: [
          ListView.builder(
              physics: const ScrollPhysics(),
              shrinkWrap: true,
              itemCount: 6,
              itemBuilder: (context, index) {
                return Padding(
                  padding: const EdgeInsets.all(8.0),
                  child:
                      Container(width: 100, height: 100, color: Colors.green),
                );
              }),
          ListView.builder(
              physics: const ScrollPhysics(),
              shrinkWrap: true,
              itemCount: 5,
              itemBuilder: (context, index) {
                return Padding(
                  padding: const EdgeInsets.all(8.0),
                  child:
                      Container(width: 100, height: 100, color: Colors.purple),
                );
              }),
        ]),
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return [];
        },
      ),
    );
  }
}

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: scrollingViewports, list views, slivers, etc.found in release: 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-macBuilding on or for macOS specificallyr: fixedIssue is closed as already fixed in a newer versionwaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions