Skip to content

fix(secure_storage): Add plugin platform entry. #5178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 22, 2024

Conversation

Equartey
Copy link
Contributor

Issue #, if available:
#5165
Description of changes:
Followed Flutter doc guidance to specify platform specific entry points for the Secure Storage plugin. This resolves the build errors from Flutter Master channel:

Package amplify_secure_storage:linux references amplify_secure_storage_dart:linux as the default plugin, but the package does not exist.
Ask the maintainers of amplify_secure_storage to either avoid referencing a default implementation via `platforms: linux: default_package: amplify_secure_storage_dart` or create a plugin named amplify_secure_storage_dart.

Package amplify_secure_storage:windows references amplify_secure_storage_dart:windows as the default plugin, but the package does not exist.
Ask the maintainers of amplify_secure_storage to either avoid referencing a default implementation via `platforms: windows: default_package: amplify_secure_storage_dart` or create a plugin named amplify_secure_storage_dart.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Equartey Equartey requested a review from a team as a code owner July 18, 2024 17:51

// Required to register the plugin on windows and linux platforms.
// https://docs.flutter.dev/packages-and-plugins/developing-packages#plugin-platforms
static void registerWith() {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can this can be a no-op? There isn't a instance from the current impl to map here.

plugin:
platforms:
linux:
default_package: amplify_secure_storage_dart
Copy link
Member

Choose a reason for hiding this comment

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

default_package would typically refer to another package. This references itself. Is that something flutter docs suggest doing?

What I am seeing in the docs is to use dartPluginClass

Suggested change
default_package: amplify_secure_storage_dart
dartPluginClass: AmplifySecureStorageDart

You will also have to add a registerWith() method to AmplifySecureStorageDart I believe. This is based on https://docs.flutter.dev/packages-and-plugins/developing-packages#dart-only-platform-implementations

@Equartey Equartey force-pushed the fix/secure-storage-plugin-def branch from d246d16 to f6b49e8 Compare July 19, 2024 19:06
@Equartey Equartey merged commit 85fe599 into main Jul 22, 2024
79 checks passed
@Equartey Equartey deleted the fix/secure-storage-plugin-def branch July 22, 2024 19:50
tyllark pushed a commit to tyllark/amplify-flutter that referenced this pull request Aug 14, 2024
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.

3 participants