Skip to content

DataTable: customizable mouse cursor #123020

Closed

Description

@jpnurmi

Use case

It would be nice to be able to set the basic mouse cursor on desktop platforms to match the look'n'feel of the desktop and other apps around.

image

DataTable does not expose API for setting the mouse cursor. Given that interactive table rows are wrapped with TableRowInkWell, the mouse cursor ends up being InkWell's default i.e. the clickable mouse cursor.

Proposal

Expose API to be able to set mouse cursor on desktop platforms.

Related issues

Activity

  1. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    c: proposalA detailed proposal for a change to Flutter
    a: mouseIssues related to using a mouse or mouse support
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    and removed
    in triagePresently being triaged by the triage team
    on Mar 21, 2023
  2. TahaTesser commented on Mar 21, 2023

    @TahaTesser
    Contributor

    I'm working on this @jpnurmi. Should be an easy fix.

  3. TahaTesser commented on Mar 21, 2023

    @TahaTesser
    Contributor

    @jpnurmi
    It'd be like this, what do you think?

                mouseCursor: MaterialStateProperty.resolveWith<MouseCursor>((Set<MaterialState> states) {
                  if (states.contains(MaterialState.selected)) {
                    return SystemMouseCursors.copy;
                  }
                  return SystemMouseCursors.contextMenu;
                }),
                cells: <DataCell>[DataCell(Text('Row $index'))],
                selected: selected[index],
                onSelectChanged: (bool? value) {
    Screen.Recording.2023-03-21.at.10.56.33.mov
  4. jpnurmi commented on Mar 21, 2023

    @jpnurmi
    MemberAuthor

    @TahaTesser wow, that was quick! 🚀 looks good! notice that the header may also change the cursor if sortable.

  5. TahaTesser commented on Mar 21, 2023

    @TahaTesser
    Contributor

    @jpnurmi
    Added cursor customizable for header cell as well.
    I'd appreciate it if you can test my code implementation and provide any feedback on the behavior and naming #123128

  6. self-assigned this
    on Mar 21, 2023
  7. moved this from To do to PR submitted in Nevercodeon Mar 21, 2023
  8. jpnurmi commented on Mar 21, 2023

    @jpnurmi
    MemberAuthor

    Awesome, will do! 👍

  9. added
    P3Issues that are less important to the Flutter project
    on Mar 23, 2023
  10. moved this from PR submitted to Done (PR merged) in Nevercodeon Mar 24, 2023
  11. added
    r: fixedIssue is closed as already fixed in a newer version
    on Mar 24, 2023
  12. github-actions commented on Apr 7, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projecta: desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions