Skip to content

[proposal] DataTable - have a way to disable the inkwell effect #70755

@nukotsuka

Description

@nukotsuka

Problem

When I build DataTable with DataRow.onSelectChanged == null and DataCell.onTap == null, rendered cells in the table have TableRowInkWell.

Causes

In _buildDataCell, if onTap == null and onSelectChanged == null, then TableRowInkWell is set to label.

if (onTap != null) {
label = InkWell(
onTap: onTap,
child: label,
overlayColor: overlayColor,
);
} else if (onSelectChanged != null) {
label = TableRowInkWell(
onTap: onSelectChanged,
child: label,
overlayColor: overlayColor,
);
}

But this method is always called so that onSelectChanged is not null.

onSelectChanged: () => row.onSelectChanged != null ? row.onSelectChanged!(!row.selected) : null,

I think this part should look like this:

onSelectChanged: row.onSelectChanged != null ? () =>  row.onSelectChanged!(!row.selected) : null,

And I also found similar parts:

onRowTap: () => row.onSelectChanged != null ? row.onSelectChanged!(!row.selected) : null ,

if (onRowTap != null) {
contents = TableRowInkWell(
onTap: onRowTap,
child: contents,
overlayColor: overlayColor,
);
}

Flutter Doctor

Log
[✓] Flutter (Channel beta, 1.23.0-18.1.pre, on Mac OS X 10.15.7 19H2 x86_64, locale ja-JP)
    • Flutter version 1.23.0-18.1.pre at /Users/taka/Flutter/flutter
    • Framework revision 198df796aa (5 weeks ago), 2020-10-15 12:04:33 -0700
    • Engine revision 1d12d82d9c
    • Dart version 2.11.0 (build 2.11.0-213.1.beta)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/taka/Library/Android/sdk
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = /Users/taka/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    • CocoaPods version 1.10.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.2.3)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 41.1.3
    • Dart plugin version 192.7402

[✓] Connected device (3 available)
    • nukotsuka 11 (mobile) • 00008030-001108E20AD0802E • ios            • iOS 14.0
    • Web Server (web)      • web-server                • web-javascript • Flutter Tools
    • Chrome (web)          • chrome                    • web-javascript • Google Chrome 86.0.4240.198

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    Status

    Issue closed with comment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions