Skip to content

PageView doesn't do hit testing right with padding (SliverFillViewport hit test issue?) #27744

@Suraj-Tiwari

Description

@Suraj-Tiwari

InkWell will not work if _file.length is 1;
but it will work if length is greater than or equal to 2;

  Container(
    height: 200,
    child: PageView.builder(
      itemCount: _file.length,
      controller: PageController(viewportFraction: 0.4),
      itemBuilder: (context, index) {
        return Card(
          child: InkWell(
            onTap: () => _picImage(),
            child: Center(
              child: Icon(
                Icons.add,
                size: 40,
              ),
            ),
          ),
        );
      },
    ),
  )
flutter doctor -v

[√] Flutter (Channel beta, v1.0.0, on Microsoft Windows [Version 10.0.17758.1], locale en-AS)
    • Flutter version 1.0.0 at C:\flutter
    • Framework revision 5391447fae (2 months ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

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

[√] Android Studio (version 3.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 32.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] IntelliJ IDEA Ultimate Edition (version 2018.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.3
    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

PS: Using Android Studio Not Intellij for Flutter

Metadata

Metadata

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions