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

[shared_preferences] Add shared_preferences_windows #2988

Merged

Conversation

stuartmorgan-g
Copy link
Contributor

Description

Dart implementation of the shared_preferences plugin using ffi for Windows.

This is #2631, trimmed down to the initial stand-alone PR that adds shared_preferences_windows, since it must be landed and published before the shared_preferences registration and endorsement can land.

Related Issues

flutter/flutter#41719

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@stuartmorgan-g stuartmorgan-g force-pushed the shared-preferences-windows branch from 8f5b134 to 351244a Compare September 2, 2020 14:02
@stuartmorgan-g
Copy link
Contributor Author

This is now working, and passing the experimental CI bots. However, looking again at the way it's doing path storage, and comparing with the Linux implementation, it makes a lot more sense to hold off on this until path_provider_windows is landed, and then use it to get the storage location instead of having the Win32 code duplicated here (with different logic for constructing the subpath, as compared to path_provider). Once path_provider_windows is in I'll rework this to depend on it, as we do with shared_preferences_linux.

@stuartmorgan-g
Copy link
Contributor Author

stuartmorgan-g commented Sep 5, 2020

@franciscojma86 Can you approve the co-authorship here when you get a chance? I've done a fair amount of rewriting based on what we learned from some of the Linux plugins, especially aligning it with the basic structure of shared_preferences_linux due the fact that path_provider_windows is now mostly complete, but it's still very much based on your PR.

@franciscojma86
Copy link
Contributor

@googlebot I consent.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Sep 8, 2020
@franciscojma86
Copy link
Contributor

So exciting!

@stuartmorgan-g stuartmorgan-g marked this pull request as draft September 8, 2020 22:57
@stuartmorgan-g
Copy link
Contributor Author

stuartmorgan-g commented Sep 8, 2020

This is essentially done, it just needs a trivial pubspec updated after path_provider_windows 0.0.2 is published (#2818).

@stuartmorgan-g stuartmorgan-g marked this pull request as ready for review September 16, 2020 13:54
Copy link
Contributor

@csells csells left a comment

Choose a reason for hiding this comment

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

I don't think we're calculating the path where the shared preferences are stored correctly.

@stuartmorgan-g stuartmorgan-g merged commit f17376f into flutter:master Sep 18, 2020
@stuartmorgan-g stuartmorgan-g deleted the shared-preferences-windows branch September 18, 2020 19:09
danielroek pushed a commit to Baseflow/flutter-plugins that referenced this pull request Oct 1, 2020
Windows implementation of the shared_preferences plugin, using Dart+FFI.
jorgefspereira pushed a commit to jorgefspereira/plugins_flutter that referenced this pull request Oct 10, 2020
Windows implementation of the shared_preferences plugin, using Dart+FFI.
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
Windows implementation of the shared_preferences plugin, using Dart+FFI.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants