fix: align Dart-side defaults with Python across all packages#6330
Merged
FeodorFitsner merged 3 commits intomainfrom Mar 19, 2026
Merged
fix: align Dart-side defaults with Python across all packages#6330FeodorFitsner merged 3 commits intomainfrom
FeodorFitsner merged 3 commits intomainfrom
Conversation
Multiple map-related fixes and defaults:
- Example: set SafeArea expand=True in basic map example to allow full expansion.
- Tile layer: use BaseControl instead of LayoutControl when composing TileLayerControl.
- Map utils: change fadeIn start/reload opacities default to 0.0; set pinch_move_threshold default to 40.0; provide fallback durations for performLeapTriggerDuration and animationCurveReverseDuration; make cursor keyboard trigger nullable when trigger_keys is absent; set WMS tile layer defaults for format ('image/png') and version ('1.1.1').
These changes prevent null/undefined behavior and ensure sensible defaults for map interactions and tile rendering.
…hanged - Dismissible: read "movement_duration"/"resize_duration" instead of "duration" for both - Image: add default `false` for gapless_playback - ExpansionTile: add default `true` for enable_feedback - DataTable2: fix sort_arrow_animation_duration unit (microseconds → milliseconds) - Geolocator: fix notification_set_ongoing default (true → false) - SecureStorage: fix WebOptions db_name/public_key to use "Flet" prefix
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns Dart-side default values and property keys with their Python counterparts across several built-in controls and extension packages, addressing regressions introduced by skipping transmission of unchanged default props from Python to Flutter (notably impacting flet-map, Issue #6329).
Changes:
- Fixes multiple Dart-side default mismatches (booleans, durations, strings, and map-related config defaults) so Flutter behavior matches Python when properties are omitted.
- Corrects property key usage and units (e.g.,
Dismissibleduration keys,DataTable2animation duration units). - Updates extension developer documentation to highlight the requirement for matching defaults on both sides.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/packages/flet/docs/extend/user-extensions.md | Adds a warning/advice section explaining why Dart defaults must match Python defaults for extensions. |
| sdk/python/packages/flet-secure-storage/src/flutter/flet_secure_storage/lib/src/utils/secure_storage.dart | Updates SecureStorage web default names to the Flet* prefix to match Python defaults. |
| sdk/python/packages/flet-map/src/flutter/flet_map/lib/src/utils/map.dart | Aligns multiple map-related defaults (tile display opacities, interaction thresholds, WMS defaults, keyboard/cursor rotation parsing). |
| sdk/python/packages/flet-map/src/flutter/flet_map/lib/src/tile_layer.dart | Switches wrapper from LayoutControl to BaseControl for TileLayer. |
| sdk/python/packages/flet-geolocator/src/flutter/flet_geolocator/lib/src/utils/geolocator.dart | Fixes comment typo and aligns Android foreground notification “ongoing” default with Python. |
| sdk/python/packages/flet-datatable2/src/flutter/flet_datatable2/lib/src/datatable2.dart | Fixes sort_arrow_animation_duration default unit (ms instead of µs). |
| sdk/python/examples/controls/map/basic.py | Updates map example layout (SafeArea(expand=True)). |
| packages/flet/lib/src/controls/image.dart | Adds missing Dart-side default for gapless_playback (false). |
| packages/flet/lib/src/controls/expansion_tile.dart | Adds missing Dart-side default for enable_feedback (true). |
| packages/flet/lib/src/controls/dismissible.dart | Fixes reading movement_duration / resize_duration instead of incorrectly reusing "duration". |
| .codex/skills/implement-flet-extension/SKILL.md | Documents the “default value matching” rule for extension implementation guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sdk/python/packages/flet-map/src/flutter/flet_map/lib/src/utils/map.dart
Show resolved
Hide resolved
Deploying flet-docs with
|
| Latest commit: |
a8f86b7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3ace373c.flet-docs.pages.dev |
| Branch Preview URL: | https://map-fix.flet-docs.pages.dev |
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 #6329
Summary
"duration"for bothmovementDurationandresizeDuration— now correctly reads"movement_duration"and"resize_duration"falseforgapless_playbacktrueforenable_feedbacksort_arrow_animation_durationunit —microseconds→milliseconds(was 1,000,000x off)notification_set_ongoingdefault —true→falseto match PythonWebOptions.db_name/public_keyto use"Flet"prefix instead of"Flutter"FadeInTileDisplayopacities,KeyboardOptionsdurations,WMSTileLayerConfigurationformat/version,CursorKeyboardRotationOptionstrigger_keys null handling, switched TileLayer toBaseControlContext
Since props with default values are no longer sent from Python to Flutter when unchanged, every Dart-side property read must provide the same default as its Python counterpart. A systematic audit of all 17 hybrid packages identified and fixed mismatches across 6 packages.
Test plan
Dismissiblewith custommovement_duration/resize_durationvaluesDataTable2sort arrow animation timingSecureStorageweb options work with default db/key names