From f8193a4aa5504cd885d50f111639be1d420cf622 Mon Sep 17 00:00:00 2001 From: David Bebawy Date: Tue, 13 Jan 2026 14:06:26 -0500 Subject: [PATCH] docs: update Swift Package Manager pubspec.yaml syntax to use config section The `disable-swift-package-manager` field is deprecated. Update the documentation to use the new `flutter: config: enable-swift-package-manager` syntax introduced in flutter/flutter#168433. Also added a migration note to help users who were using the old syntax. Fixes flutter/website#12924 --- .../swift-package-manager/how-to-enable-disable.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/_includes/docs/swift-package-manager/how-to-enable-disable.md b/src/_includes/docs/swift-package-manager/how-to-enable-disable.md index e401feabc66..752fbf3eb97 100644 --- a/src/_includes/docs/swift-package-manager/how-to-enable-disable.md +++ b/src/_includes/docs/swift-package-manager/how-to-enable-disable.md @@ -50,16 +50,23 @@ instructions. ### Turn off for a single project In the project's `pubspec.yaml` file, under the `flutter` section, -add `disable-swift-package-manager: true`. +set `enable-swift-package-manager` to `false` in the `config` subsection. ```yaml title="pubspec.yaml" # The following section is specific to Flutter packages. flutter: - disable-swift-package-manager: true + config: + enable-swift-package-manager: false ``` This turns off Swift Package Manager for all contributors to this project. +:::note Migrating from deprecated syntax +If you were previously using `disable-swift-package-manager: true`, +update your `pubspec.yaml` to use the new `config` section format shown above. +The old syntax is deprecated and will produce an error in Flutter 3.38 and later. +::: + ### Turn off globally for all projects Run the following command: