flutter / website

Flutter documentation web site
https://docs.flutter.dev
Other
2.8k stars 3.2k forks source link

Add a "Choose your platform implementation directory" dropdown to SwiftPM plugin migration docs #10974

Open loic-sharma opened 1 month ago

loic-sharma commented 1 month ago

Problem

For the plugin migration docs, the top-level folder that contains your plugin's code can be ios, macos, or darwin. Our guide states we'll use ios in our instructions, and that the reader should use whatever is the correct value for their plugin:

The example below uses ios, replace ios with macos/darwin as applicable.

For example, step 11 says:

  1. Update your ios/plugin_name.podspec to point to new paths.

If the plugin uses the darwin directory, that file will actually be at darwin/plugin_name.podspec.

This could be confusing for readers.

Solution

The first step in the migration guide could be "Choose your platform implementation directory: " and a dropdown with values ios, macos, or darwin.

Once you select an implementation folder, the guide's text would update automatically to use all the correct paths.

This was feedback from the walkthrough: https://github.com/flutter/flutter/issues/152276

Part of https://github.com/flutter/flutter/issues/126005

cc @parlough

sfshaza2 commented 1 month ago

I like the idea!