Skip to content

feat: make SharedPreferences support int, float, bool and list[str]#6267

Merged
FeodorFitsner merged 17 commits intomainfrom
improve-shared-prefs
Mar 17, 2026
Merged

feat: make SharedPreferences support int, float, bool and list[str]#6267
FeodorFitsner merged 17 commits intomainfrom
improve-shared-prefs

Conversation

@ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Mar 6, 2026

Fix #6304

Summary by Sourcery

Extend SharedPreferences to support multiple primitive types and lists while improving platform build configuration handling and documentation.

New Features:

  • Allow SharedPreferences to store and retrieve str, int, float, bool, and list[str] values across Python and Flutter layers.
  • Document how to use subprocess to invoke external system commands from Flet apps, including Android-specific examples.

Bug Fixes:

  • Make CLI boolean parsing for macOS entitlements and Android features/permissions case-insensitive to avoid unexpected failures.
  • Correct documentation references for permissions resolution order and flet run docs paths.
  • Fix ads package changelog by converting the Unreleased section into a tagged 0.82.0 release entry with proper issue and PR links.

Enhancements:

  • Clarify and standardize CLI and TOML value formats for iOS, macOS, and Android build options and entitlements, with richer examples and template translations.
  • Tighten SharedPreferences type validation and add a dedicated type alias for supported value types in the Python API.
  • Improve type hints and navigation in Python docs and auth APIs, including OAuth token typing and cookbook link fixes.
  • Refine Flet CLI build command help text and link to the full publishing guide.
  • Update deep linking and publishing docs with additional platform references and concrete manifest/plist translation examples.
  • Add Subprocess cookbook page to the documentation navigation.
  • Clarify release-preparation skill instructions for changelog handling and author attribution.

Documentation:

  • Expand platform-specific publishing docs (iOS, macOS, Android) with supported value forms, examples, and rendered template snippets.
  • Add detailed deep linking examples for Android and iOS, showing how TOML config maps to platform manifests.
  • Introduce a new cookbook recipe demonstrating safe subprocess usage, including launching Android activities from Flet apps.

Tests:

  • Broaden SharedPreferences integration tests to cover all supported value types and rejection of unsupported types.

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 expands SharedPreferences to support additional primitive value types end-to-end (Python SDK ↔ Flutter service), while also updating build CLI boolean parsing/help text and making several documentation improvements (publish guides + cookbook).

Changes:

  • Extend SharedPreferences to support int, float, bool, and list[str] (Python typing + Dart service implementation) and broaden integration test coverage.
  • Update flet build CLI boolean parsing to be case-insensitive for several flags and align related publish documentation/examples.
  • Add a new cookbook article (Subprocess) and update MkDocs navigation; apply assorted docs/changelog/lockfile maintenance updates.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
sdk/python/packages/flet/src/flet/controls/services/shared_preferences.py Adds a SharedPreferencesValueType alias, tighter input validation, and improved docstrings.
packages/flet/lib/src/services/shared_preferences.dart Implements multi-type set/get support using the platform shared_preferences API.
sdk/python/packages/flet/integration_tests/controls/services/test_shared_preferences.py Extends CRUD integration test to cover new supported types and invalid inputs.
sdk/python/packages/flet-cli/src/flet_cli/commands/build_base.py Makes several CLI boolean parsers case-insensitive and tweaks help text.
sdk/python/packages/flet/src/flet/auth/authorization_service.py Adds an explicit return type to get_token().
sdk/python/packages/flet/docs/publish/android.md Docs updates for resolution order, boolean forms, and “template translation” examples.
sdk/python/packages/flet/docs/publish/ios.md Docs updates for supported forms/examples and template-translation sections.
sdk/python/packages/flet/docs/publish/macos.md Docs updates for supported forms/examples and template-translation sections.
sdk/python/packages/flet/docs/publish/index.md Adds “template translation” details and updates deep-linking references/links.
sdk/python/packages/flet/docs/cookbook/subprocess.md New cookbook recipe covering subprocess usage (non-web).
sdk/python/packages/flet/docs/cookbook/assets.md Updates control link format for Image.
sdk/python/packages/flet/mkdocs.yml Adds the new Subprocess cookbook page to navigation.
sdk/python/packages/flet-cli/src/flet_cli/commands/build.py Adds a publish documentation link in the command docstring.
sdk/python/packages/flet-ads/CHANGELOG.md Changelog entry formatting/version section update.
client/pubspec.lock Updates pinned Dart transitive dependencies.
.codex/skills/prepare-flet-release/SKILL.md Tightens release-prep instructions (author attribution + changelog scan guidance).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 16, 2026

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 192a291
Status:⚡️  Build in progress...

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 16, 2026

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 302d3ca
Status: ✅  Deploy successful!
Preview URL: https://756fd75b.flet-examples.pages.dev
Branch Preview URL: https://improve-shared-prefs.flet-examples.pages.dev

View logs

@FeodorFitsner FeodorFitsner merged commit d49bac7 into main Mar 17, 2026
31 of 86 checks passed
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.

feature: Support types other than str in shared_preferences Make flet build --android-permissions support case-insensitive values

3 participants