Skip to content

Conversation

@victorsanni
Copy link
Contributor

@victorsanni victorsanni commented Jun 4, 2024

Adds mouseCursor property in Radio to CupertinoRadio and Radio.adaptive.

The mouseCursor property added is of type MouseCursor and not WidgetStateProperty<MouseCursor> to match Radio's mouseCursor.

Part of #58192

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. f: cupertino flutter/packages/flutter/cupertino repository labels Jun 4, 2024
@victorsanni victorsanni marked this pull request as ready for review June 4, 2024 18:59
expect(find.byKey(key), findsNothing);
// Release pointer after widget disappeared.
await gesture.up();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test that sets and verifies the mouse cursor when the user provides a WidgetStateProperty?

Copy link
Contributor Author

@victorsanni victorsanni Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. I think I've run into an issue here.

It turns out that I can't even provide a WidgetStateProperty<MouseCursor> to the Material equivalent - only MouseCursors are allowed. Should I

a) Refactor in CupertinoRadio so that mouseCursor is a WidgetStateProperty<MouseCursor> and not a MouseCursor (possibly doing the same in Radio) or

b) Have mouseCursor be a plain old MouseCursor here?

cc @MitchellGoodwin

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we have an existing plan to convert parameters like these to WidgetStateProperty, maybe @MitchellGoodwin knows? Should we be making stuff like this a WidgetStateProperty when we can?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I currently do is keep mouseCursor as a MouseCursor, then if the user wants to configure mouseCursor in different widget states they can use WidgetStateMouseCursor. I added a test reflecting this behavior.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the caveat that we should figure out what to do about making mouseCursor a WidgetStateProperty.

expect(find.byKey(key), findsNothing);
// Release pointer after widget disappeared.
await gesture.up();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we have an existing plan to convert parameters like these to WidgetStateProperty, maybe @MitchellGoodwin knows? Should we be making stuff like this a WidgetStateProperty when we can?

await gesture.moveTo(tester.getCenter(find.byType(CupertinoRadio<int>)));
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1),
kIsWeb ? SystemMouseCursors.click : SystemMouseCursors.basic);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Maybe also add a test to Radio.adaptive that tests that CupertinoRadio ends up with the mouseCursor.

Copy link
Contributor Author

@victorsanni victorsanni Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might such a test be necessary, considering Radio.adaptive delegates to CupertinoRadio on iOS/macOS (and a test for that exists), and given the CupertinoRadio mouse cursor tests written here?

@victorsanni victorsanni changed the title Add mouse cursor property to CupertinoRadio Add mouse cursor property to CupertinoRadio Jun 10, 2024
@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 12, 2024
@auto-submit auto-submit bot merged commit 3db2ece into flutter:master Jun 12, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 12, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 12, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 12, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 13, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jun 13, 2024
flutter/flutter@b1f9d71...01db23b

2024-06-13 [email protected] Roll Flutter Engine from c7fcbfce608f to 4cb3025d3abf (28 revisions) (flutter/flutter#150199)
2024-06-13 [email protected] Revert "[CupertinoActionSheet] Add sliding tap gesture" (flutter/flutter#150147)
2024-06-13 [email protected] RawScrollbar: don't listen for drag gestures when scrolling is not possible (flutter/flutter#149925)
2024-06-13 [email protected] Update testowners (flutter/flutter#150141)
2024-06-12 [email protected] Revert "Reland 2: [CupertinoActionSheet] Match colors to native" (flutter/flutter#150142)
2024-06-12 [email protected] Reland 2: [CupertinoActionSheet] Match colors to native (flutter/flutter#150129)
2024-06-12 49699333+dependabot[bot]@users.noreply.github.com Bump actions/checkout from 4.1.6 to 4.1.7 (flutter/flutter#150132)
2024-06-12 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.25.8 to 3.25.9 (flutter/flutter#150133)
2024-06-12 [email protected] Improve build time when using SwiftPM (flutter/flutter#150052)
2024-06-12 [email protected] Reland: Request focus if accessibility focus is given to a Focus widget (#142942) (flutter/flutter#149840)
2024-06-12 [email protected] Update WidgetStatesController docs (flutter/flutter#150081)
2024-06-12 [email protected] [Reland] Fix `SegmentedButton` clipping when drawing segments (#149739) (flutter/flutter#150090)
2024-06-12 [email protected] Fix markdown hyperlinks in the style guide (flutter/flutter#150071)
2024-06-12 [email protected] Update packages desktop PR triage link lables (flutter/flutter#150124)
2024-06-12 [email protected] Add mouse cursor property to `CupertinoRadio` (flutter/flutter#149681)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni added a commit to victorsanni/flutter that referenced this pull request Jun 14, 2024
Adds `mouseCursor` property in `Radio` to `CupertinoRadio` and `Radio.adaptive`.

The `mouseCursor` property added is of type `MouseCursor` and not `WidgetStateProperty<MouseCursor>` to match `Radio`'s `mouseCursor`.
victorsanni added a commit to victorsanni/flutter that referenced this pull request Jun 14, 2024
Adds `mouseCursor` property in `Radio` to `CupertinoRadio` and `Radio.adaptive`.

The `mouseCursor` property added is of type `MouseCursor` and not `WidgetStateProperty<MouseCursor>` to match `Radio`'s `mouseCursor`.
@victorsanni victorsanni deleted the improve-cupertino-radio branch July 12, 2024 00:28
auto-submit bot pushed a commit that referenced this pull request Jul 19, 2024
#149681 introduced `mouseCursor `to `CupertinoRadio` as a `MouseCursor` instead of a `WidgetStateProperty` to match Material Radio's `mouseCursor` property for `.adaptive`.

This PR changes `mouseCursor` to be of type `WidgetStateProperty<MouseCursor>` as per review comments in #151788 (comment).

PR bringing `mouseCursor` into `CupertinoRadio`: #149681.

Part of #58192
victorsanni added a commit to victorsanni/flutter that referenced this pull request Jul 19, 2024
…r#151910)

flutter#149681 introduced `mouseCursor `to `CupertinoRadio` as a `MouseCursor` instead of a `WidgetStateProperty` to match Material Radio's `mouseCursor` property for `.adaptive`.

This PR changes `mouseCursor` to be of type `WidgetStateProperty<MouseCursor>` as per review comments in flutter#151788 (comment).

PR bringing `mouseCursor` into `CupertinoRadio`: flutter#149681.

Part of flutter#58192
victorsanni added a commit to victorsanni/flutter that referenced this pull request Jul 19, 2024
…r#151910)

flutter#149681 introduced `mouseCursor `to `CupertinoRadio` as a `MouseCursor` instead of a `WidgetStateProperty` to match Material Radio's `mouseCursor` property for `.adaptive`.

This PR changes `mouseCursor` to be of type `WidgetStateProperty<MouseCursor>` as per review comments in flutter#151788 (comment).

PR bringing `mouseCursor` into `CupertinoRadio`: flutter#149681.

Part of flutter#58192
victorsanni added a commit to victorsanni/flutter that referenced this pull request Jul 22, 2024
…r#151910)

flutter#149681 introduced `mouseCursor `to `CupertinoRadio` as a `MouseCursor` instead of a `WidgetStateProperty` to match Material Radio's `mouseCursor` property for `.adaptive`.

This PR changes `mouseCursor` to be of type `WidgetStateProperty<MouseCursor>` as per review comments in flutter#151788 (comment).

PR bringing `mouseCursor` into `CupertinoRadio`: flutter#149681.

Part of flutter#58192
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…r#151910)

flutter#149681 introduced `mouseCursor `to `CupertinoRadio` as a `MouseCursor` instead of a `WidgetStateProperty` to match Material Radio's `mouseCursor` property for `.adaptive`.

This PR changes `mouseCursor` to be of type `WidgetStateProperty<MouseCursor>` as per review comments in flutter#151788 (comment).

PR bringing `mouseCursor` into `CupertinoRadio`: flutter#149681.

Part of flutter#58192
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…r#151910)

flutter#149681 introduced `mouseCursor `to `CupertinoRadio` as a `MouseCursor` instead of a `WidgetStateProperty` to match Material Radio's `mouseCursor` property for `.adaptive`.

This PR changes `mouseCursor` to be of type `WidgetStateProperty<MouseCursor>` as per review comments in flutter#151788 (comment).

PR bringing `mouseCursor` into `CupertinoRadio`: flutter#149681.

Part of flutter#58192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants