Skip to content

fix: align Dart-side defaults with Python across all packages#6330

Merged
FeodorFitsner merged 3 commits intomainfrom
map-fix
Mar 19, 2026
Merged

fix: align Dart-side defaults with Python across all packages#6330
FeodorFitsner merged 3 commits intomainfrom
map-fix

Conversation

@FeodorFitsner
Copy link
Contributor

@FeodorFitsner FeodorFitsner commented Mar 19, 2026

Fix #6329

Summary

  • Dismissible: fixed reading "duration" for both movementDuration and resizeDuration — now correctly reads "movement_duration" and "resize_duration"
  • Image: added missing default false for gapless_playback
  • ExpansionTile: added missing default true for enable_feedback
  • DataTable2: fixed sort_arrow_animation_duration unit — microsecondsmilliseconds (was 1,000,000x off)
  • Geolocator: fixed notification_set_ongoing default — truefalse to match Python
  • SecureStorage: fixed WebOptions.db_name/public_key to use "Flet" prefix instead of "Flutter"
  • Map: fixed multiple default mismatches — FadeInTileDisplay opacities, KeyboardOptions durations, WMSTileLayerConfiguration format/version, CursorKeyboardRotationOptions trigger_keys null handling, switched TileLayer to BaseControl
  • Docs: added warning about matching Python↔Dart defaults for extension developers

Context

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

  • Run map basic example to confirm no regression
  • Test Dismissible with custom movement_duration/resize_duration values
  • Test DataTable2 sort arrow animation timing
  • Verify SecureStorage web options work with default db/key names

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
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.

We've reviewed this pull request using the Sourcery rules engine

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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., Dismissible duration keys, DataTable2 animation 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.

@cloudflare-workers-and-pages
Copy link

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: a8f86b7
Status: ✅  Deploy successful!
Preview URL: https://3ace373c.flet-docs.pages.dev
Branch Preview URL: https://map-fix.flet-docs.pages.dev

View logs

@FeodorFitsner FeodorFitsner merged commit a4287c8 into main Mar 19, 2026
65 of 108 checks passed
@FeodorFitsner FeodorFitsner deleted the map-fix branch March 19, 2026 18:52
@FeodorFitsner FeodorFitsner added this to the 0.83.0 milestone Mar 19, 2026
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.

bug: flet-map not working starting from 0.82.3.dev7889

2 participants