feat(flet-map): add Map.get_camera(), MapEventType, and enhance MapEvent payload#6208
Open
ndonkoHenri wants to merge 14 commits intomainfrom
Open
feat(flet-map): add Map.get_camera(), MapEventType, and enhance MapEvent payload#6208ndonkoHenri wants to merge 14 commits intomainfrom
Map.get_camera(), MapEventType, and enhance MapEvent payload#6208ndonkoHenri wants to merge 14 commits intomainfrom
Conversation
Map.get_camera(), MapEventType, and enhanced MapEvent payloadMap.get_camera(), MapEventType, and enhance MapEvent payload
Deploying flet-docs with
|
| Latest commit: |
f92a359
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d131e37a.flet-docs.pages.dev |
| Branch Preview URL: | https://improve-map.flet-docs.pages.dev |
Deploying flet-examples with
|
| Latest commit: |
f92a359
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8b7d7d7f.flet-examples.pages.dev |
| Branch Preview URL: | https://improve-map.flet-examples.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new camera-query and richer event typing to the flet-map Python/Flutter integration to address frequent on_position_change updates by allowing consumers to query a stable camera snapshot and classify map events.
Changes:
- Added
Map.get_camera()method (Flutter invoke + Python API) to retrieve the current camera snapshot on demand. - Introduced
MapEventTypeand expandedMapEventpayload withevent_type,old_camera,coordinates, andid. - Updated docs navigation and Map docs page, plus added multiple new/updated Python examples.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/packages/flet/mkdocs.yml | Adds MapEventType to generated docs navigation. |
| sdk/python/packages/flet/docs/map/types/mapeventtype.md | New docs stub to render MapEventType API reference. |
| sdk/python/packages/flet/docs/map/index.md | Expands Map docs with multiple example snippets. |
| sdk/python/packages/flet-map/src/flutter/flet_map/lib/src/utils/map.dart | Refactors enum parsing, switches event wiring to hasEventHandler, and enriches MapEvent serialization payload. |
| sdk/python/packages/flet-map/src/flutter/flet_map/lib/src/utils/attribution_alignment.dart | Refactors enum parsing to shared parseEnum. |
| sdk/python/packages/flet-map/src/flutter/flet_map/lib/src/map.dart | Adds "get_camera" invoke-method and normalizes null args handling. |
| sdk/python/packages/flet-map/src/flet_map/types.py | Adds MapEventType, expands MapEvent, and fixes MapEventSource.INTERACTIVE_FLAGS_CHANGED value. |
| sdk/python/packages/flet-map/src/flet_map/map.py | Adds Map.get_camera() Python API and updates some docstrings. |
| sdk/python/packages/flet-map/src/flet_map/init.py | Re-exports MapEventType. |
| sdk/python/packages/flet-map/CHANGELOG.md | Documents new API additions and the event-source fix. |
| sdk/python/examples/controls/map/multi_layers.py | Updates example to use layer variables (walrus assignment) instead of Ref. |
| sdk/python/examples/controls/map/interaction_flags.py | New example showing interaction flag toggling and event introspection. |
| sdk/python/examples/controls/map/idle_camera.py | New example demonstrating “camera idle” pattern using MapEventType + get_camera(). |
| sdk/python/examples/controls/map/camera_controls.py | New example for imperative camera control methods + get_camera(). |
| sdk/python/examples/controls/map/basic.py | New minimal map example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…n Flet documentation
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #6196
Summary by Sourcery
Extend flet-map with richer map events and camera inspection while updating docs and examples to showcase new capabilities.
New Features:
Bug Fixes:
Enhancements:
Documentation: