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

[path_provider] Switch macOS to an internal method channel #4547

Merged
merged 5 commits into from
Dec 3, 2021

Conversation

stuartmorgan
Copy link
Contributor

Eliminates the path_provider_macos reliance on the default, shared method channel implementation, in favor of an in-package implementation.

Now that it's trivial to do so, also moves the creation of directories when necessary to the Dart side, and unit tests it there.

Part of flutter/flutter#94224

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.

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

nice!


@override
Future<String?> getDownloadsPath() {
return methodChannel.invokeMethod<String>('getDownloadsDirectory');
Copy link
Member

Choose a reason for hiding this comment

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

Might be worthwhile adding a note that the mix match of names is intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's no reason method channels need to parallel platform interfaces, so I don't really consider it a mismatch; all that is expected (and required) to match is the Dart and native endpoints.

(Longer term this should probably be replaced with a single method+enum using Pigeon, to more closely mirror the OS API, but I just wanted to do the initial cleanup of using an internal method channel for now.)

@stuartmorgan stuartmorgan merged commit 178e365 into flutter:master Dec 3, 2021
@stuartmorgan stuartmorgan deleted the path-provider-macos-dart branch December 3, 2021 17:32
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 3, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 3, 2021
amantoux pushed a commit to amantoux/plugins that referenced this pull request Dec 11, 2021
)

Eliminates the path_provider_macos reliance on the default, shared method channel implementation, in favor of an in-package implementation.

Now that it's trivial to do so, also moves the creation of directories when necessary to the Dart side, and unit tests it there.

Part of flutter/flutter#94224
KyleFin pushed a commit to KyleFin/plugins that referenced this pull request Dec 21, 2021
)

Eliminates the path_provider_macos reliance on the default, shared method channel implementation, in favor of an in-package implementation.

Now that it's trivial to do so, also moves the creation of directories when necessary to the Dart side, and unit tests it there.

Part of flutter/flutter#94224
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants