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: expose missing py-events in Map #3464

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

ndonkoHenri
Copy link
Collaborator

@ndonkoHenri ndonkoHenri commented Jun 14, 2024

Description

Some map events where added on dart end, but forgotten on py end.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Summary by Sourcery

This pull request introduces new event handlers for various map interactions, including position changes and pointer events. It also refactors existing event handling to use more specific event classes and updates several map-related classes to use a unified event callback type.

  • New Features:
    • Added new event handlers for on_position_change, on_pointer_down, on_pointer_cancel, and on_pointer_up in the MapInteractionConfiguration class.
    • Introduced MapPointerDeviceType enum to represent different types of pointer devices.
    • Created new event classes MapTapEvent, MapPositionChangeEvent, and MapPointerEvent to handle specific map events.
  • Enhancements:
    • Refactored existing event handlers in MapInteractionConfiguration to use specific event classes like MapTapEvent and MapEvent.
    • Updated SimpleAttribution, TextSourceAttribution, and TileLayer classes to use OptionalEventCallback for event handlers.

Copy link
Contributor

sourcery-ai bot commented Jun 14, 2024

Reviewer's Guide by Sourcery

This pull request adds missing map events to the Python end of the Map component, ensuring that events such as on_position_change, on_pointer_down, on_pointer_cancel, and on_pointer_up are now properly exposed and handled. The changes involve adding new event classes, updating event handlers, and modifying existing classes to support the new events.

File-Level Changes

Files Changes
sdk/python/packages/flet-core/src/flet_core/map/simple_attribution.py
sdk/python/packages/flet-core/src/flet_core/map/text_source_attribution.py
sdk/python/packages/flet-core/src/flet_core/map/tile_layer.py
Updated event handlers to use OptionalEventCallback for on_click and on_image_error events.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a 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: 6 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@FeodorFitsner FeodorFitsner merged commit a7a9d17 into main Jun 14, 2024
3 checks passed
FeodorFitsner pushed a commit that referenced this pull request Jun 17, 2024
…ies to `Window` and `BrowserContextMenu` classes (#3463)

* initial commit

* commit

* update Window

* create BrowserContextMenu class

* chore: remove deprecation_warning and reformat deprecated

* change signal to SIG_DFL after exit_gracefully (#3466)

* improve type hint for run_task and run_thread (#3459)

* add type hint

* fix Future[RetT]

* feat(map): add missing py-events, better typing (#3464)

* initial commit

* commit

* update Window

* create BrowserContextMenu class

* chore: remove deprecation_warning and reformat deprecated

* Geolocator: rename some classes and methods

---------

Co-authored-by: Zhan Rongrui <46243324+zrr1999@users.noreply.github.com>
@ndonkoHenri ndonkoHenri deleted the missing-map-events branch July 2, 2024 20:46
zrr1999 pushed a commit to zrr1999/flet that referenced this pull request Jul 17, 2024
zrr1999 added a commit to zrr1999/flet that referenced this pull request Jul 17, 2024
…ies to `Window` and `BrowserContextMenu` classes (flet-dev#3463)

* initial commit

* commit

* update Window

* create BrowserContextMenu class

* chore: remove deprecation_warning and reformat deprecated

* change signal to SIG_DFL after exit_gracefully (flet-dev#3466)

* improve type hint for run_task and run_thread (flet-dev#3459)

* add type hint

* fix Future[RetT]

* feat(map): add missing py-events, better typing (flet-dev#3464)

* initial commit

* commit

* update Window

* create BrowserContextMenu class

* chore: remove deprecation_warning and reformat deprecated

* Geolocator: rename some classes and methods

---------

Co-authored-by: Zhan Rongrui <46243324+zrr1999@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants