-
Notifications
You must be signed in to change notification settings - Fork 584
Fix PieChartEvent.type
on web
#3611
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
Conversation
Reviewer's Guide by SourceryThis pull request addresses issue #3546 by improving the event handling in the PieChart component for web. It introduces a mapping for Flutter event types to string representations and includes local position data in the event payload. Additionally, minor adjustments were made to the Theme and ScrollableControl classes for better type handling and code cleanup. File-Level Changes
Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ndonkoHenri - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 5 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
const eventMap = { | ||
"FlPointerEnterEvent": "pointerEnter", | ||
"FlPointerExitEvent": "pointerExit", | ||
"FlPointerHoverEvent": "pointerHover", | ||
"FlPanCancelEvent": "panCancel", | ||
"FlPanDownEvent": "panDown", | ||
"FlPanEndEvent": "panEnd", | ||
"FlPanStartEvent": "panStart", | ||
"FlPanUpdateEvent": "panUpdate", | ||
"FlLongPressEnd": "longPressEnd", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider making eventMap private
If eventMap
is only used within this file, consider prefixing it with an underscore to indicate that it is private and should not be accessed from outside this module.
Can you resolve conflict here please? |
# Conflicts: # sdk/python/packages/flet-core/src/flet_core/charts/pie_chart.py # sdk/python/packages/flet-core/src/flet_core/scrollable_control.py
Fixes #3546
Tried another approach, but the issue is still present.
AI's opinion on the cause of the issue:
What I found strange is the fact that, when testing on web using
flutter run -d chrome
it works (shows the right types).Summary by Sourcery
This pull request addresses the issue with
PieChartEvent.type
on web by mapping Flutter event types to readable event names. It also enhances the event data by adding local position information and introduces an enum for event types in the Python SDK.PieChartEvent.type
on web by mapping Flutter event types to readable event names.localPosition
toPieChartEventData
to capture the local position of events.PieChartEventType
enum in Python to standardize event type values.