Skip to content

[shared_preferences] switch to ffi/jni pigeon - #12329

Draft
tarrinneal wants to merge 3 commits into
flutter:mainfrom
tarrinneal:spffijni
Draft

[shared_preferences] switch to ffi/jni pigeon#12329
tarrinneal wants to merge 3 commits into
flutter:mainfrom
tarrinneal:spffijni

Conversation

@tarrinneal

Copy link
Copy Markdown
Contributor

for example

@tarrinneal

Copy link
Copy Markdown
Contributor Author

@stuartmorgan-g this is a working example of switching to ffi/jni pigeon. the pr contains all of the pigeon changes, but you can just look at the shared preferences stuff

@tarrinneal tarrinneal added the CICD Run CI/CD label Aug 4, 2026

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The iOS part generally looks good, but one question on the binary file. The Android part I have more questions about the structure of main package vs example package.

@@ -52,3 +52,89 @@ dependencies {
androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0")
api("androidx.test:core:1.4.0")
}
// Gradle stub for listing dependencies in JNIgen. If found in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know this isn't in our direct control, but something we should raise for long-term jnigen discussions: I worry about the maintenance of this code. It's in a user-controlled file, not a generated file, which means that if it needs to change in the future there will need to be some potentially non-trivial migration.

(On the other hand, that's also true of the Flutter plugin system itself.)

Comment thread packages/shared_preferences/shared_preferences_android/example/pubspec.yaml Outdated
Comment thread packages/shared_preferences/shared_preferences_android/pigeons/messages.dart Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants