Skip to content

CupertinoActionSheetAction cursor doesn't change to clickable on desktop. #154792

Closed

Description

@TahaTesser

Steps to reproduce

Run the CupertinoActionSheetAction code sample below.

Expected results

Expected a way to change cursor on desktop

Actual results

No cursor change

Code sample

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      theme: const CupertinoThemeData(
        brightness: Brightness.light,
      ),
      home: CupertinoPageScaffold(
        child: Center(
          child: Builder(builder: (BuildContext context) {
            return CupertinoButton(
              onPressed: () {
                showCupertinoModalPopup<void>(
                  context: context,
                  builder: (BuildContext context) {
                    return CupertinoActionSheet(
                      title: const Text('The title'),
                      message: const Text('Message'),
                      actions: <Widget>[
                        CupertinoActionSheetAction(
                          child: const Text('One'),
                          onPressed: () {},
                        ),
                      ],
                    );
                  },
                );
              },
              child: const Text('Go'),
            );
          }),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel main, 3.25.0-1.0.pre.283, on macOS 15.0 24A5327a
    darwin-arm64, locale en-US)
    • Flutter version 3.25.0-1.0.pre.283 on channel main at
      /Users/tahatesser/Code/flutter
    ! Upstream repository [email protected]:TahaTesser/flutter.git is not the same
      as FLUTTER_GIT_URL
    • FLUTTER_GIT_URL = [email protected]:TahaTesser/flutter.gitexport
    • Framework revision aea84342eb (3 days ago), 2024-09-05 16:46:22 -0700
    • Engine revision 015f3b1dec
    • Dart version 3.6.0 (build 3.6.0-216.0.dev)
    • DevTools version 2.39.0
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/tahatesser/Code/android-sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_SDK_ROOT = /Users/tahatesser/Code/android-sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Build 16A5230g
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2024.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
      17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.92.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.94.0

[✓] Connected device (4 available)
    • Taha’s iPhone (mobile)          • 00008120-001C559034DB401E • ios
      • iOS 18.0 22A5350a
    • macOS (desktop)                 • macos                     • darwin-arm64
      • macOS 15.0 24A5327a darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin
      • macOS 15.0 24A5327a darwin-arm64
    • Chrome (web)                    • chrome                    •
      web-javascript • Google Chrome 128.0.6613.120

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Activity

  1. TahaTesser commented on Sep 8, 2024

    @TahaTesser
    ContributorAuthor

    As part of #86174 (comment), we added cursor support for web. The cursor on native macOS apps do not change automatically to a clickable cursor. Maybe we could benefit from a mouseCursor property.

    I'm not actively working on Cupertino so I'll leave this for someone who can fix it.

    cc: @nilsreichardt for making me aware of this issue

  2. added
    in triagePresently being triaged by the triage team
    on Sep 9, 2024
  3. huycozy commented on Sep 9, 2024

    @huycozy
    Member

    I can reproduce this issue on macOS as well. We can temporarily work around this by wrapping CupertinoActionSheetAction with a MouseRegion like this:

    MouseRegion(
      cursor: SystemMouseCursors.click,
      child: CupertinoActionSheetAction(
        child: const Text('One'),
        onPressed: () {},
      ),
    ),

    Reproduced this on Flutter stable 3.24.2 and master 3.25.0-1.0.pre.303.

  4. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    platform-macosBuilding on or for macOS specifically
    p: cupertino_uicupertino_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-macosOwned by the macOS platform team
    a: mouseIssues related to using a mouse or mouse support
    and removed
    in triagePresently being triaged by the triage team
    on Sep 9, 2024
  5. added
    team-designOwned by Design Languages team
    and removed
    team-macosOwned by the macOS platform team
    on Sep 9, 2024
  6. 9 remaining items

  7. dkwingsmt commented on Nov 5, 2024

    @dkwingsmt
    Contributor

    Feel free to work it at your convenience :)

    I can think of 3 steps of doing this:

    1. Make CupertinoActionSheetAction's cursor pointer without being configurable
    2. Add a configurable property CupertinoActionSheetAction.cursor
    3. Allow the property to make use of WidgetState.

    Completing step 1 should be sufficient to close this issue, but step 2 would be welcome too. Step 3 is not necessary if you think it's too hard.

    If you search for final MouseCursor you can find a lot of examples of how other widgets define it.

  8. srivats22 commented on Nov 7, 2024

    @srivats22
    Contributor

    As part of #86174 (comment), we added cursor support for web. The cursor on native macOS apps do not change automatically to a clickable cursor. Maybe we could benefit from a mouseCursor property.

    I'm not actively working on Cupertino so I'll leave this for someone who can fix it.

    cc: @nilsreichardt for making me aware of this issue

    As mentioned since this was introduced as part of #86174
    I am thinking we can do something like this:
    cursor: (kIsWeb || Platform.isMacOS) ? SystemMouseCursors.click : MouseCursor.defer,
    Which will result in below behavior

    Screen.Recording.2024-11-07.at.8.06.46.AM.mov

    So this will take care of point 1: Make CupertinoActionSheetAction's cursor pointer without being configurable

    Please let me know if this is ok. or any changes need to be made

    I will continue to work on number 2 and try number 3 as well

    Can this be assigned to me?

  9. TahaTesser commented on Nov 7, 2024

    @TahaTesser
    ContributorAuthor

    @srivats22 Assigned you.

  10. victorsanni commented on Nov 7, 2024

    @victorsanni
    Contributor

    I am thinking we can do something like this: cursor: (kIsWeb || Platform.isMacOS) ? SystemMouseCursors.click : MouseCursor.defer,

    I am confused here.

    Currently, the cursor only becomes clickable on web. However, we want to be able to configure it to be clickable on desktop, if desired.

    This change seems to just make it always clickable on desktop, which I think isn't what we want. Isn't the goal to introduce a property that allows the user configure what mouseCursor they would like to use, independent of platform?

    Please feel free to correct me if I am missing something.

  11. srivats22 commented on Nov 7, 2024

    @srivats22
    Contributor

    I am thinking we can do something like this: cursor: (kIsWeb || Platform.isMacOS) ? SystemMouseCursors.click : MouseCursor.defer,

    I am confused here.

    Currently, the cursor only becomes clickable on web. However, we want to be able to configure it to be clickable on desktop, if desired.

    This change seems to just make it always clickable on desktop, which I think isn't what we want. Isn't the goal to introduce a property that allows the user configure what mouseCursor they would like to use, independent of platform?

    Please feel free to correct me if I am missing something.

    I think I misunderstood the requirements while reading the reply below. I will work on making the cursor configurable. And for web it will be what it is right now and for desktop I will let the user pass the cursor they want otherwise will just default it

    #154792 (comment)

    Thanks

  12. srivats22 commented on Nov 11, 2024

    @srivats22
    Contributor

    Hi
    PR: #158470 is ready for review and this will address this issue

    Thanks

  13. added a commit that references this issue on Nov 13, 2024
  14. added
    r: fixedIssue is closed as already fixed in a newer version
    on Nov 14, 2024
  15. github-actions commented on Nov 28, 2024

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

  16. locked as resolved and limited conversation to collaborators on Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopa: mouseIssues related to using a mouse or mouse supportfound in release: 3.24Found to occur in 3.24found in release: 3.25Found to occur in 3.25frameworkflutter/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: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages teamworkaround availableThere is a workaround available to overcome the issue

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions