Skip to content

Mouse cursor doesn't change to pointer when hovering over CupertinoDialogAction on Desktop #169037

Closed

Description

@OutdatedGuy

Steps to reproduce

  1. Run sample code on macOS platform
  2. Open a dialog using Click Me button
  3. Hover over the dialog action button
  4. See mouse style has not changed to pointer (hand)

Expected results

Mouse style should change to pointer when hovering over dialog action button

Actual results

Mouse style doesn't change (remains the same)

Code sample

Code sample
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: MyHomePage());
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: ElevatedButton(
          onPressed: _showDialog,
          child: const Text('Click Me'),
        ),
      ),
    );
  }

  void _showDialog() {
    showAdaptiveDialog(
      context: context,
      builder: (_) {
        return AlertDialog.adaptive(
          title: const Text('Adaptive Dialog'),
          content: const Text('This is an adaptive dialog.'),
          actions: [
            CupertinoDialogAction(
              onPressed: () => Navigator.of(context).pop(),
              child: const Text('OK'),
            ),
          ],
        );
      },
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
macOS Web
Screen.Recording.2025-05-17.at.11.45.55.PM.mov
Screen.Recording.2025-05-17.at.11.47.04.PM.mov

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.29.3, on macOS 15.5 24F74 darwin-arm64, locale en-IN) [1,456ms]
    • Flutter version 3.29.3 on channel stable at /Users/me/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ea121f8859 (5 weeks ago), 2025-04-11 19:10:07 +0000
    • Engine revision cf56914b32
    • Dart version 3.7.2
    • DevTools version 2.42.3

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [2.2s]
    • Android SDK at /Users/me/Library/Android/sdk
    • Platform android-36, build-tools 36.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.6+-13368085-b895.109)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [1,966ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16E140
    • CocoaPods version 1.16.2

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

[✓] Android Studio (version 2024.3) [13ms]
    • 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.6+-13368085-b895.109)

[✓] VS Code (version 1.100.2) [10ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.110.0

[✓] Connected device (3 available) [6.5s]
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 15.5 24F74 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 15.5 24F74 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 136.0.7103.114

[✓] Network resources [1,188ms]
    • All expected network resources are available.

• No issues found!

Activity

  1. tirth-patel-nc commented on May 18, 2025

    @tirth-patel-nc
    Member

    Triage Report

    I was able to reproduce the issue using the provided code sample on both the stable (3.29.3) and master (3.33.0-1.0.pre.122) channels.

    Related Issues: #59576, #58192

    Code Sample (Same as OP)
    import 'package:flutter/cupertino.dart';
    import 'package:flutter/material.dart';
    
    void main() {
      runApp(const MyApp());
    }
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(home: MyHomePage());
      }
    }
    
    class MyHomePage extends StatefulWidget {
      const MyHomePage({super.key});
    
      @override
      State<MyHomePage> createState() => _MyHomePageState();
    }
    
    class _MyHomePageState extends State<MyHomePage> {
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: Center(
            child: ElevatedButton(
              onPressed: _showDialog,
              child: const Text('Click Me'),
            ),
          ),
        );
      }
    
      void _showDialog() {
        showAdaptiveDialog(
          context: context,
          builder: (_) {
            return AlertDialog.adaptive(
              title: const Text('Adaptive Dialog'),
              content: const Text('This is an adaptive dialog.'),
              actions: [
                CupertinoDialogAction(
                  onPressed: () => Navigator.of(context).pop(),
                  child: const Text('OK'),
                ),
              ],
            );
          },
        );
      }
    }
    stable (3.29.3) - flutter doctor -v
    [✓] Flutter (Channel stable, 3.29.3, on macOS 15.4.1 24E263 darwin-arm64, locale
        en-IN) [970ms]
        • Flutter version 3.29.3 on channel stable at
          /Users/tirthpatel/Development/flutter_stable/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ea121f8859 (4 weeks ago), 2025-04-11 19:10:07 +0000
        • Engine revision cf56914b32
        • Dart version 3.7.2
        • DevTools version 2.42.3
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
        [855ms]
        • Android SDK at /Users/tirthpatel/Library/Android/sdk
        • Platform android-36, build-tools 36.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.6+-13355223-b631.42)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 16.3) [556ms]
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 16E140
        • CocoaPods version 1.16.2
    
    [✓] Chrome - develop for the web [9ms]
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2024.3) [9ms]
        • 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.6+-13355223-b631.42)
    
    [✓] VS Code (version 1.99.3) [8ms]
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension can be installed from:
          🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    
    [✓] Connected device (3 available) [5.5s]
        • macOS (desktop)                 • macos                 • darwin-arm64   •
          macOS 15.4.1 24E263 darwin-arm64
        • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         •
          macOS 15.4.1 24E263 darwin-arm64
        • Chrome (web)                    • chrome                • web-javascript •
          Google Chrome 135.0.7049.115
    
    [✓] Network resources [559ms]
        • All expected network resources are available.
    
    • No issues found!
    
    master (3.33.0-1.0.pre.122) - flutter doctor -v
    [✓] Flutter (Channel master, 3.33.0-1.0.pre.122, on macOS 15.4.1 24E263 darwin-arm64, locale en-IN) [1,315ms]
        • Flutter version 3.33.0-1.0.pre.122 on channel master at /Users/tirthpatel/Development/flutter_master/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision a682cf27b2 (27 hours ago), 2025-05-17 00:54:34 -0400
        • Engine revision a682cf27b2
        • Dart version 3.9.0 (build 3.9.0-138.0.dev)
        • DevTools version 2.46.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [756ms]
        • Android SDK at /Users/tirthpatel/Library/Android/sdk
        • Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
        • Platform android-36, build-tools 36.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.6+-13355223-b631.42)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 16.3) [446ms]
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 16E140
        • CocoaPods version 1.16.2
    
    [✓] Chrome - develop for the web [8ms]
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2024.3) [8ms]
        • 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.6+-13355223-b631.42)
    
    [✓] VS Code (version 1.100.2) [7ms]
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.110.0
    
    [✓] Connected device (2 available) [5.6s]
        • macOS (desktop) • macos  • darwin-arm64   • macOS 15.4.1 24E263 darwin-arm64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 136.0.7103.114
    
    [✓] Network resources [509ms]
        • All expected network resources are available.
    
    • No issues found!
    
  2. added
    a: mouseIssues related to using a mouse or mouse support
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: cupertino_uicupertino_ui package in flutter/packages
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on May 18, 2025
  3. changed the title [-]Mouse style doesn't change to `pointer` when overing over CupertinoDialogAction on macOS[/-] [+]Mouse style doesn't change to `pointer` when overing over CupertinoDialogAction on Desktop[/+] on May 18, 2025
  4. changed the title [-]Mouse style doesn't change to `pointer` when overing over CupertinoDialogAction on Desktop[/-] [+]Mouse style doesn't change to `pointer` when hovering over CupertinoDialogAction on Desktop[/+] on May 19, 2025
  5. changed the title [-]Mouse style doesn't change to `pointer` when hovering over CupertinoDialogAction on Desktop[/-] [+]Mouse cursor doesn't change to `pointer` when hovering over CupertinoDialogAction on Desktop[/+] on May 21, 2025
  6. dkwingsmt commented on May 21, 2025

    @dkwingsmt
    Contributor

    It's expected. On macOS (in general, on desktop) mouse cursors don't change to hand when hovering over buttons, unless it's on a Web page. You can try it on all kinds of system apps (not Chrome).

  7. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 21, 2025
  8. OutdatedGuy commented on May 24, 2025

    @OutdatedGuy
    ContributorAuthor

    @dkwingsmt does that not apply to the material widgets? Cuz all (probably) material widgets changes cursor style on all desktop platforms.

  9. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on May 24, 2025
  10. dkwingsmt commented on May 24, 2025

    @dkwingsmt
    Contributor

    @OutdatedGuy Funnily I was a little surprised to know it (even though I added mouse cursor to them myself) and had to check some code to confirm. That being said, I think the design still makes sense since for Material we can not reference the experience on any desktop platforms but tablets, while for Cupertino we were mirroring macOS.

    In general setting default mouse cursors were a hard job due to lack of specs and I have to admit that some of them probably was chosen inconsistently. I'm open to different ideas for discussion.

  11. OutdatedGuy commented on May 25, 2025

    @OutdatedGuy
    ContributorAuthor

    @dkwingsmt it makes sense to not change cursor style by default for cupertino widgets as macOS and it's system apps follow that practise. But having a way to change cursor style easily (e.g. with a property value) would be nice to keep UI consistency when using both Material and Cupertino elements.

    CupertinoSwitch has a mouseCursor property, so making all (almost) widgets to have that property would be great for consistency.

  12. dkwingsmt commented on Jun 5, 2025

    @dkwingsmt
    Contributor

    I agree! Although, the issues you mentioned would be duplicate of #58192. I'm therefore going to close this issue. Please don't hesitate to reopen or file a new issue if you have more questions. And if you're willing to add the mouseCursor property to the widgets, feel free to ask me for review! Thank you!

  13. added a commit that references this issue on Jun 18, 2025
    5ecde8a
  14. github-actions commented on Jun 19, 2025

    @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.

  15. locked as resolved and limited conversation to collaborators on Jun 19, 2025
  16. added a commit that references this issue on Jul 21, 2025
    44882be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportfound in release: 3.29Found to occur in 3.29found in release: 3.33Found to occur in 3.33frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagesr: duplicateIssue is closed as a duplicate of an existing issueteam-designOwned by Design Languages teamwaiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions