Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add momentary varient of CupertinoSlidingSegmentedControl #164262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rkishan516
Copy link
Contributor

Feat: Add momentary varient of CupertinoSlidingSegmentedControl
fixes: #164077

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels Feb 27, 2025
@rkishan516 rkishan516 force-pushed the sliding-segmented-control-momentary branch from 1d13bdb to 77e7ded Compare February 28, 2025 16:41
@rkishan516
Copy link
Contributor Author

@QuncCccccc Can you please review this PR ?

@QuncCccccc QuncCccccc self-requested a review March 12, 2025 03:51
Copy link
Contributor

@QuncCccccc QuncCccccc left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

I compared the native SegmentedControl behavior with the newly added behavior here, and they look quite different.

For native component, when momentary is turned on and we tap/press a segment, the text would animate a little and go back to the original size, and onValueChanged is still get called when we tap one of the segments.

Screen.Recording.2025-03-14.at.3.17.01.PM.mov

I'm not sure what would be the use case of momentary flag, but if we really need this feature, we might want to match the native behavior as much as possible:)

@rkishan516
Copy link
Contributor Author

rkishan516 commented Mar 14, 2025

Thanks for your contribution!

I compared the native SegmentedControl behavior with the newly added behavior here, and they look quite different.

For native component, when momentary is turned on and we tap/press a segment, the text would animate a little and go back to the original size, and onValueChanged is still get called when we tap one of the segments.

Screen.Recording.2025-03-14.at.3.17.01.PM.mov
I'm not sure what would be the use case of momentary flag, but if we really need this feature, we might want to match the native behavior as much as possible:)

Sure, I'll try to match as much as possible.

Edit :- Have allowed onValueChanged onTap and also Updated onTap animation.

@rkishan516 rkishan516 force-pushed the sliding-segmented-control-momentary branch 3 times, most recently from 22f7262 to 01e0257 Compare March 15, 2025 05:06
@rkishan516 rkishan516 force-pushed the sliding-segmented-control-momentary branch from 01e0257 to df72eb9 Compare March 15, 2025 05:06
@rkishan516 rkishan516 requested a review from QuncCccccc March 15, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support isMomentary feature for CupertinoSlidingSegmentedControl
3 participants