Add mouse cursor property to CupertinoRadio#149681
Add mouse cursor property to CupertinoRadio#149681auto-submit[bot] merged 5 commits intoflutter:masterfrom
CupertinoRadio#149681Conversation
| @@ -428,4 +429,45 @@ void main() { | |||
| // Release pointer after widget disappeared. | |||
| await gesture.up(); | |||
| }); | |||
There was a problem hiding this comment.
Can you add a test that sets and verifies the mouse cursor when the user provides a WidgetStateProperty?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
justinmc
left a comment
There was a problem hiding this comment.
LGTM with the caveat that we should figure out what to do about making mouseCursor a WidgetStateProperty.
| @@ -428,4 +429,45 @@ void main() { | |||
| // Release pointer after widget disappeared. | |||
| await gesture.up(); | |||
| }); | |||
There was a problem hiding this comment.
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); | ||
| }); |
There was a problem hiding this comment.
Nit: Maybe also add a test to Radio.adaptive that tests that CupertinoRadio ends up with the mouseCursor.
There was a problem hiding this comment.
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?
CupertinoRadio
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
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`.
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`.
#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
…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
…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
…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
…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
…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
Adds
mouseCursorproperty inRadiotoCupertinoRadioandRadio.adaptive.The
mouseCursorproperty added is of typeMouseCursorand notWidgetStateProperty<MouseCursor>to matchRadio'smouseCursor.Part of #58192
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.