Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[shared_preferences] Merge iOS and macOS implementations - #6920

Merged
stuartmorgan-g merged 15 commits into
flutter-team-archive:mainfrom
stuartmorgan-g:shared-preferences-foundation-rename
Jan 10, 2023
Merged

stuartmorgan-g merged 15 commits into
flutter-team-archive:mainfrom
stuartmorgan-g:shared-preferences-foundation-rename

Conversation

@stuartmorgan-g

@stuartmorgan-g stuartmorgan-g commented Jan 6, 2023 •

Copy link
Copy Markdown
Contributor

This merges shared_preferences_ios and shared_preferences_macos into a new shared_preferences_foundations that replaces both of those packages, as described in flutter/flutter#117941:

  • Renames shared_preferences_macos to shared_prefrences_foundation, since the macOS implementation is the Swift implementation, which is what we want to use going forward.
  • Moves the implementation files to a shared directory (called darwin/ in anticipation of Allow iOS and macOS plugins to share darwin directory flutter/flutter#115337), adjusting the code and podspec slightly to make it iOS-compatible
  • Adds iOS support to the example, via flutter create-ing a new iOS example and wiring it up to use the existing native unit test. (This was done instead of moving the example from shared_preferences_ios since it seemed better to have the example be in Swift as well now.)
  • Removes shared_preferences_ios.

Once this lands and has been published, a follow-up will update shared_preferences to use this new package instead of the other two, and the old ones will be marked as deprecated on pub.dev.

Part of flutter/flutter#117941

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.