Skip to content

ListWheelScrollView children do not respond on gesture (onTap) events #38803

@kofan

Description

@kofan

Steps to Reproduce

Hi! Here is my widget that uses ListWheelScrollView with FixedExtentScrollController:

import 'package:flutter/material.dart';

class LetterWheel extends StatefulWidget {
  const LetterWheel({Key key}) : super(key: key);

  @override
  _LetterWheelState createState() => _LetterWheelState();
}

class _LetterWheelState extends State<LetterWheel> {
  FixedExtentScrollController scrollController;

  @override
  void initState() {
    scrollController = FixedExtentScrollController();
    super.initState();
  }

  @override
  void dispose() {
    scrollController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return ListWheelScrollView(
      controller: scrollController,
      physics: const FixedExtentScrollPhysics(),
      itemExtent: 110,
      children: ['A', 'B', 'C', 'D', 'E', 'F', 'G']
          .map(
            (letter) => Container(
              margin: const EdgeInsets.all(10),
              height: 90,
              color: Colors.yellow,
              child: GestureDetector(
                onTap: () => print('Letter "$letter" is pressed.'),
                child: Center(
                  child: Text(
                    letter,
                    style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
                  ),
                ),
              ),
            ),
          )
          .toList(),
    );
  }
}

Expected result: When the list item is tapped the message is printed to the console.

Actual result: When the list item is tapped nothing happens.

Here is my flutter doctor -v output:

[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F203, locale en-UA)
    • Flutter version 1.7.8+hotfix.3 at /Users/mkofan/Software/flutter
    • Framework revision b712a172f9 (6 weeks ago), 2019-07-09 13:14:38 -0700
    • Engine revision 54ad777fd2
    • Dart version 2.4.0

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
    • Android SDK at /Users/mkofan/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • CocoaPods version 1.7.4

[✓] iOS tools - develop for iOS devices
    • ios-deploy 1.9.4

[!] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.37.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.3.0

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

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.f: gesturesflutter/packages/flutter/gestures repository.f: scrollingViewports, list views, slivers, etc.found in release: 1.18Occurs in 1.18found in release: 1.24Found to occur in 1.24frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions