You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow creating "darwin" (shared codebase for ios/macos) plugins directly in flutter create #161019
Right now when you create darwin plugin, you have to start with an ios or macos template. Then follow the docs. There are clearly some differences between macos and ios templates. Which one is preferred to start with? Why not just add a darwin platform?
Proposal
Simply make 'darwin' a valid platform option and create a darwin project directly from CLI.
This issue is assigned to @okorohelijah but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
This issue was assigned to @okorohelijah but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
flutter-triage-bot commentedon Sep 16, 2025
This issue is assigned to @okorohelijah but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
flutter-triage-bot commentedon Sep 16, 2025
This issue was assigned to @okorohelijah but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.
stuartmorgan-g commentedon Sep 16, 2025
Commenting to convince the bot not to unassign.
jmagman commentedon Sep 16, 2025
Here's an example of one in the wild: https://github.com/flutter/packages/blob/7ff1b38ea79cac09fa2c49adf4128db0e5ae4dbb/packages/google_sign_in/google_sign_in_ios/pubspec.yaml#L15-L22
mgenware commentedon Oct 2, 2025
Had to create a darwin plugin again. Here are all steps.
iosfolder todarwin.For legacy cocoapods support.
Update
<your plugin>.podspec, replace iOS config with iOS and macOS config:For swift pm support, add minimum macOS version in
package.swiftplatformsfield:In
pubspec.yaml, addsharedDarwinSource:In your plugin implementation swift code. Replace imports with macOS support:
In plugin
registerfunc, there's some nuances to handle:Now, you should be able to compile both platforms with a shared codebase.
Add shared Darwin implementation for plugins (#176495)
Add shared Darwin implementation for plugins (flutter#176495)
Add shared Darwin implementation for plugins (flutter#176495)
github-actions commentedon Dec 11, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.