Repository navigation
Closed
flutter/packages
#13523Labels
P2Important issues not at the top of the work listfound in release: 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team
Description
Steps to reproduce
- Run following snippet in DartPad.
- Move cursor along table rows.
- You should see blinks of hover color.
Expected results
Row must keep hover color during cursor moving
Actual results
Hover color changes to a different one for a millisecond, causing a blink.
Code sample
Code sample
import 'package:flutter/material.dart';
/// Flutter code sample for [DataTable].
void main() => runApp(const DataTableExampleApp());
class DataTableExampleApp extends StatelessWidget {
const DataTableExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('DataTable Sample')),
body: const DataTableExample(),
),
);
}
}
class DataTableExample extends StatelessWidget {
const DataTableExample({super.key});
@override
Widget build(BuildContext context) {
return Theme(
data: ThemeData(hoverColor: Colors.red.withOpacity(0.9)),
child: DataTable(
columns: const <DataColumn>[
DataColumn(
label: Expanded(
child: Text(
'Name',
style: TextStyle(fontStyle: FontStyle.italic),
),
),
),
DataColumn(
label: Expanded(
child: Text('Age', style: TextStyle(fontStyle: FontStyle.italic)),
),
),
DataColumn(
label: Expanded(
child: Text(
'Role',
style: TextStyle(fontStyle: FontStyle.italic),
),
),
),
],
rows: <DataRow>[
DataRow(
onSelectChanged: (value) {},
cells: <DataCell>[
DataCell(Text('Sarah')),
DataCell(Text('19')),
DataCell(Text('Student')),
],
),
DataRow(
onSelectChanged: (value) {},
cells: <DataCell>[
DataCell(Text('Janine')),
DataCell(Text('43')),
DataCell(Text('Professor')),
],
),
DataRow(
onSelectChanged: (value) {},
cells: <DataCell>[
DataCell(Text('William')),
DataCell(Text('27')),
DataCell(Text('Associate Professor')),
],
),
],
),
);
}
}Screenshots or Video
Screenshots / Video demonstration
Screen.Recording.2025-03-28.at.15.47.29.mov
Logs
Logs
flutter runFlutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.3.2 24D81 darwin-x64, locale en-GB) [1,276ms]
• Flutter version 3.29.0 on channel stable at /Users/user/development/fluttersdk
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 35c388afb5 (7 weeks ago), 2025-02-10 12:48:41 -0800
• Engine revision f73bfc4522
• Dart version 3.7.0
• DevTools version 2.42.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [4.3s]
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2) [4.3s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16C5032a
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [33ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.3) [32ms]
• 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 21.0.5+-12932927-b750.29)
[✓] VS Code (version 1.98.1) [30ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.106.0
[✓] Connected device (2 available) [7.7s]
• macOS (desktop) • macos • darwin-x64 • macOS 15.3.2 24D81 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 134.0.6998.166
[✓] Network resources [844ms]
• All expected network resources are available.Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listfound in release: 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team
Activity
maheshj01 commentedon Mar 28, 2025
Reproducible on latest stable and the master channel.
Screen.Recording.2025-03-28.at.19.40.40.mov
flutter doctor -v
master
stable
[-]Bug in DataTable widget: DataTableRow loses hover state when moving the cursor along it.[/-][+][DataTable]: DataTableRow hover flickers when moving the cursor along the row[/+]dkwingsmt commentedon Apr 2, 2025
Seems to me that the cursor hovered on the (invisible) column divider, which doesn't react to hover events.
flutter-triage-bot commentedon Apr 2, 2025
The
fyi-designlabel is redundant with theteam-designlabel.Tosemite commentedon Apr 4, 2025
Hello!
It seems that issue is caused by an unusual logic behind RenderTable, TableRowInkWell and underlying MouseRegion.
InkResponse.getRectCallback is used to redefine Rect region for pressed, hover, focus state colors. Hover action, however, is defined by MouseRegion widget that does not get the same Rect and instead uses default boundaries of TableRowInkWell, which are broken by column dividers.
I would assume that some work needs to be done in either of those widgets, though have no idea how to do it without introducing new features, such as simillar getRectCallback for MouseRegion.
I would like to take this issue, but want to hear other opinions on solution first!
[material_ui] Fix DataTable row hover flicker between cells
[material_ui] Fix DataTable row hover flicker between cells (flutter#…