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

Introducing Mouse region config for RailDestination #161381

Conversation

M97Chahboun
Copy link
Contributor

@M97Chahboun M97Chahboun commented Jan 9, 2025

Closes #160834

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. labels Jan 9, 2025
@M97Chahboun M97Chahboun marked this pull request as ready for review January 10, 2025 21:33
@M97Chahboun M97Chahboun force-pushed the Add-MouseRegion-Support-to-NavigationRailDestination branch from ff559b9 to 7888987 Compare January 11, 2025 14:46
@Piinks Piinks requested a review from nate-thegrate January 15, 2025 19:16
Copy link
Member

@nate-thegrate nate-thegrate 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 this contribution, including the documentation & test updates!

This looks to be an effective solution for #160834, but I am a bit concerned about the potential confusion between MouseRegion and MouseRegionConfig. I left a comment in the linked issue; in my opinion it'd be nice to have a more high-level discussion about which solution would be ideal before we move forward with this pull request.


/// This data class is passed to [NavigationRail]'s [NavigationRailDestination]
/// through MouseRegion to configure the hover effect.
class MouseRegionConfig {
Copy link
Member

Choose a reason for hiding this comment

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

I feel a bit uneasy about the name "mouse region config", primarily because configuring a mouse region is what the existing MouseRegion widget already does, by definition.

If I understand correctly, this class is being introduced as a workaround, since a NavigationRailDestination isn't a widget and thus cannot be wrapped with a MouseRegion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @nate-thegrate
Yes, that's correct. I have created MouseRegionConfig to support all MouseRegion parameters. This approach ensures scalability and avoids breaking changes. Do you have any specific suggestions or feedback?

Copy link
Member

Choose a reason for hiding this comment

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

As of now, I believe the best way to solve #160834 would be to rework the navigation rail destinations so it accepts a widget list. If you're interested in pursuing that, that'd be awesome, or feel free to let me know whatever thoughts you have about it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll outline my implementation plan and would appreciate your feedback before I begin.
Please note that I believe this may result in a breaking change.

@M97Chahboun M97Chahboun force-pushed the Add-MouseRegion-Support-to-NavigationRailDestination branch from a5407b5 to b79ee92 Compare January 20, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Add MouseRegion Support to NavigationRailDestination
2 participants