From a8ceb9c7521b2eb7b87daab6241db4927332f186 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 06:28:36 -0500 Subject: [PATCH 01/57] Bump actions/upload-artifact from 4.3.5 to 4.3.6 (#11016) --- .github/workflows/scorecards-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index bcef843963..1db8f98406 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -42,7 +42,7 @@ jobs: # Upload the results as artifacts (optional). - name: "Upload artifact" - uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 + uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a with: name: SARIF file path: results.sarif From c3ae8961ae33a1f72df2d15ca15a0fb65d6f140b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 06:49:16 -0500 Subject: [PATCH 02/57] Bump examples/codelabs from `00fdbc0` to `11bbf40` (#11015) --- examples/codelabs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/codelabs b/examples/codelabs index 00fdbc0b22..11bbf40040 160000 --- a/examples/codelabs +++ b/examples/codelabs @@ -1 +1 @@ -Subproject commit 00fdbc0b229f80881e0a51062d6d5f58635656e2 +Subproject commit 11bbf400406b20d2e2fa8e336416079bec7252fc From 8a0050bcd3ac77d506bf4fab2c287e1f99a54410 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 06:49:35 -0500 Subject: [PATCH 03/57] Bump github/codeql-action from 3.25.15 to 3.26.0 (#11017) --- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/scorecards-analysis.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index df096df82d..ec8215e8d2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -33,7 +33,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a + uses: github/codeql-action/init@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -44,7 +44,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a + uses: github/codeql-action/autobuild@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -58,4 +58,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a + uses: github/codeql-action/analyze@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 1db8f98406..67541f3fc6 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -50,6 +50,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a + uses: github/codeql-action/upload-sarif@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa with: sarif_file: results.sarif From 4c0e05643dff99f309e752df571f54072093050c Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Thu, 8 Aug 2024 08:22:28 -0500 Subject: [PATCH 04/57] Launch DevTools through `dart` subcommand (#11007) Closes https://github.com/flutter/devtools/issues/8153 Co-authored-by: Brett Morgan --- src/content/tools/devtools/cli.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/content/tools/devtools/cli.md b/src/content/tools/devtools/cli.md index 12434ad40f..fd547745a0 100644 --- a/src/content/tools/devtools/cli.md +++ b/src/content/tools/devtools/cli.md @@ -5,23 +5,13 @@ description: Learn how to launch and use DevTools from the command line. To run DevTools from the CLI, you must have `dart` on your path. -Then you can run either of the -following commands to launch DevTools: - -```console -dart devtools -``` -or - -```console -flutter devtools -``` +Then to launch DevTools, run the `dart devtools` command. To upgrade DevTools, upgrade Flutter. If a newer Dart SDK (which is included in the Flutter SDK) includes a newer version of DevTools, -running `devtools` automatically launches this version. +running `dart devtools` automatically launches this version. If `which dart` points to a Dart SDK _not_ included in your Flutter SDK, updating that Dart SDK won't update the Flutter version. From b536cb5cad444508a538750c170e1dba8a2c44aa Mon Sep 17 00:00:00 2001 From: Michel Feinstein Date: Thu, 8 Aug 2024 23:36:07 +1000 Subject: [PATCH 05/57] Fix missing word for-plugin-authors.md (#11013) --------- Co-authored-by: Parker Lougheed --- .../swift-package-manager/for-plugin-authors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/packages-and-plugins/swift-package-manager/for-plugin-authors.md b/src/content/packages-and-plugins/swift-package-manager/for-plugin-authors.md index 335591224e..032c84de22 100644 --- a/src/content/packages-and-plugins/swift-package-manager/for-plugin-authors.md +++ b/src/content/packages-and-plugins/swift-package-manager/for-plugin-authors.md @@ -38,8 +38,8 @@ This guide shows how to add Swift Package Manager support to a plugin that already supports CocoaPods. This ensures the plugin is usable by all Flutter projects. -Flutter plugins should _both_ Swift Package Manager and CocoaPods until further -notice. +Flutter plugins should support _both_ Swift Package Manager and CocoaPods until +further notice. Swift Package Manager adoption will be gradual. Plugins that don't support CocoaPods won't be usable by projects that haven't From 6093454a779d999ca8422823bab480df8f7dc39d Mon Sep 17 00:00:00 2001 From: Tirth Date: Fri, 9 Aug 2024 00:39:01 +0530 Subject: [PATCH 06/57] [Fix] Remove re-assignment of final variable (#11018) Remove re-assignment of final variable. Fixes #11014 --- .../breaking-changes/navigator-and-page-api.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/content/release/breaking-changes/navigator-and-page-api.md b/src/content/release/breaking-changes/navigator-and-page-api.md index 5b69e52baa..1b50fffca9 100644 --- a/src/content/release/breaking-changes/navigator-and-page-api.md +++ b/src/content/release/breaking-changes/navigator-and-page-api.md @@ -39,9 +39,9 @@ Code before migration: ```dart import 'package:flutter/material.dart'; -const MaterialPage page1 = MaterialPage(child: PlaceHolder()); -const MaterialPage page2 = MaterialPage(child: PlaceHolder()); -const MaterialPage page3 = MaterialPage(child: PlaceHolder()); +final MaterialPage page1 = MaterialPage(child: Placeholder()); +final MaterialPage page2 = MaterialPage(child: Placeholder()); +final MaterialPage page3 = MaterialPage(child: Placeholder()); void main() { final List> pages = >[page1, page2, page3]; @@ -55,7 +55,6 @@ void main() { } if (route.didPop) { pages.remove(route.settings); - pages = pages.toList(); return true; } return false; @@ -71,9 +70,9 @@ Code after migration: ```dart import 'package:flutter/material.dart'; -const MaterialPage page1 = MaterialPage(child: PlaceHolder()); -const MaterialPage page2 = MaterialPage(canPop: false, child: PlaceHolder()); -const MaterialPage page3 = MaterialPage(child: PlaceHolder()); +final MaterialPage page1 = MaterialPage(child: Placeholder()); +final MaterialPage page2 = MaterialPage(canPop: false, child: Placeholder()); +final MaterialPage page3 = MaterialPage(child: Placeholder()); void main() { final List> pages = >[page1, page2, page3]; @@ -83,7 +82,6 @@ void main() { pages: pages, onDidRemovePage: (Page page) { pages.remove(page); - pages = pages.toList(); }, ), ), From 098ddd2e2b392f2fd3ed97961996377f89fdc30d Mon Sep 17 00:00:00 2001 From: Tirth Date: Fri, 9 Aug 2024 00:40:38 +0530 Subject: [PATCH 07/57] Fix variable declaration on iOS platform view page (#11019) Fix variable declaration caused by typo. Fixes #10971 Fixes #10970 --- src/content/platform-integration/ios/platform-views.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/platform-integration/ios/platform-views.md b/src/content/platform-integration/ios/platform-views.md index 86344eaebd..9ddc497fb1 100644 --- a/src/content/platform-integration/ios/platform-views.md +++ b/src/content/platform-integration/ios/platform-views.md @@ -176,7 +176,7 @@ import UIKit ) -> Bool { GeneratedPluginRegistrant.register(with: self) - guard let pluginRegisterar = self.registrar(forPlugin: "plugin-name") else { return false } + guard let pluginRegistrar = self.registrar(forPlugin: "plugin-name") else { return false } let factory = FLNativeViewFactory(messenger: pluginRegistrar.messenger()) pluginRegistrar.register( From b367b011e238d9c6eb0bd03973580fb92dd4325f Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Thu, 8 Aug 2024 14:29:10 -0500 Subject: [PATCH 08/57] Update pnpm and npm deps (#11023) Co-authored-by: Brett Morgan --- package.json | 2 +- pnpm-lock.yaml | 66 +++++++++++++++++++++++++------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 78d14c3955..f469650bc9 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "node": ">=20.12.0", "pnpm": ">=9.1.0" }, - "packageManager": "pnpm@9.6.0", + "packageManager": "pnpm@9.7.0", "scripts": { "serve": "PRODUCTION=false eleventy --serve", "build-site-for-staging": "PRODUCTION=false eleventy", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 049701ffde..a0c1c1557d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -220,8 +220,8 @@ packages: resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} engines: {node: '>=12.22.0'} - '@pnpm/npm-conf@2.2.2': - resolution: {integrity: sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==} + '@pnpm/npm-conf@2.3.0': + resolution: {integrity: sha512-DqrO+oXGR7HCuicNy6quk6ALJSDDPKI7RZz1bP5im8mSL8J2e+9w26LdkjuAfpAjOutYUJVbnXnx4IbTQeIgfw==} engines: {node: '>=12'} '@protobufjs/aspromise@1.1.2': @@ -297,8 +297,8 @@ packages: '@types/mdurl@2.0.0': resolution: {integrity: sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==} - '@types/node@22.0.2': - resolution: {integrity: sha512-yPL6DyFwY5PiMVEwymNeqUTKsDczQBJ/5T7W/46RwLU/VH+AA8aT5TZkvBviLKLbbm0hlfftEkGrNzfRk/fofQ==} + '@types/node@22.1.0': + resolution: {integrity: sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==} '@types/request@2.48.12': resolution: {integrity: sha512-G3sY+NpsA9jnwm0ixhAFQSJ3Q9JkpLZpJbI3GMv0mIAT0y3mRabYeINzal5WOChIiaTEGQYlHOKgkaM9EisWHw==} @@ -1128,8 +1128,8 @@ packages: fn.name@1.1.0: resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} - foreground-child@3.2.1: - resolution: {integrity: sha512-PXUUyLqrR2XCWICfv6ukppP96sdFwWbNEnfEMt7jNsISjMsvaLNinAHNDYyvkyU+SZG2BTSbT5NjG+vZslfGTA==} + foreground-child@3.3.0: + resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} form-data@2.5.1: @@ -1222,8 +1222,8 @@ packages: resolution: {integrity: sha512-p9Y03Uzp/Igcs36zAaB0XTSwZ8Y0/tpYiz5KIde5By+H9DCVUSYtDWZu6aFXsWTqENMb8BD/pDT3hR8NVrPkfA==} engines: {node: '>=14'} - google-gax@4.3.8: - resolution: {integrity: sha512-SKAQKtvdjtNW3PMOhmKEqpQP+2C5ZqNKfwWxy70efpSwxvRYuAcgMJs6aRHTBPJjz3SO6ZbiXwM6WIuGYFZ7LQ==} + google-gax@4.3.9: + resolution: {integrity: sha512-tcjQr7sXVGMdlvcG25wSv98ap1dtF4Z6mcV0rztGIddOcezw4YMb/uTXg72JPrLep+kXcVjaJjg6oo3KLf4itQ==} engines: {node: '>=14'} googleapis-common@7.2.0: @@ -1680,8 +1680,8 @@ packages: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} - luxon@3.4.4: - resolution: {integrity: sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==} + luxon@3.5.0: + resolution: {integrity: sha512-rh+Zjr6DNfUYR3bPwJEnuwDdqMbxZW7LOQfUN4B54+Cl+0o5zaU9RJ6bcidfDtC1cWCZXQ+nvX8bf6bAji37QQ==} engines: {node: '>=12'} make-dir@3.1.0: @@ -2588,8 +2588,8 @@ packages: resolution: {integrity: sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g==} engines: {node: '>=14'} - terser@5.31.3: - resolution: {integrity: sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==} + terser@5.31.5: + resolution: {integrity: sha512-YPmas0L0rE1UyLL/llTWA0SiDOqIcAQYLeUj7cJYzXHlRTAnMSg9pPe4VJ5PlKvTrPQsdVFuiRiwyeNlYgwh2Q==} engines: {node: '>=10'} hasBin: true @@ -2656,8 +2656,8 @@ packages: uc.micro@2.1.0: resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} - undici-types@6.11.1: - resolution: {integrity: sha512-mIDEX2ek50x0OlRgxryxsenE5XaQD4on5U2inY7RApK3SOJpofyw7uW2AyfMKkhAxXIceo2DeWGVGwyvng1GNQ==} + undici-types@6.13.0: + resolution: {integrity: sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==} unicode-emoji-modifier-base@1.0.0: resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} @@ -2790,8 +2790,8 @@ packages: resolution: {integrity: sha512-wQCXXVgfv/wUPOfb2x0ruxzwkcZfxcktz6JIMUaPLmcNhO4bZTwA/WtDWK74xV3F2dKu8YadrFv0qhwYjVEwhA==} engines: {node: '>= 12.0.0'} - winston@3.13.1: - resolution: {integrity: sha512-SvZit7VFNvXRzbqGHsv5KSmgbEYR5EiQfDAL9gxYkRqa934Hnk++zze0wANKtMHcy/gI4W/3xmSDwlhf865WGw==} + winston@3.14.0: + resolution: {integrity: sha512-XEJvmKJglhTW2TgfpKdkpj0119Yn5AClR7LJ0rBNUQFx20mNQj3s1ukTA1i77q+YBaHYbcKtXpxgPqfdUPCIYA==} engines: {node: '>= 12.0.0'} wrap-ansi@6.2.0: @@ -2952,7 +2952,7 @@ snapshots: js-yaml: 4.1.0 kleur: 4.1.5 liquidjs: 10.16.1 - luxon: 3.4.4 + luxon: 3.5.0 markdown-it: 14.1.0 micromatch: 4.0.7 minimist: 1.2.8 @@ -3042,7 +3042,7 @@ snapshots: arrify: 2.0.1 extend: 3.0.2 google-auth-library: 9.13.0(encoding@0.1.13) - google-gax: 4.3.8(encoding@0.1.13) + google-gax: 4.3.9(encoding@0.1.13) heap-js: 2.5.0 is-stream-ended: 0.1.4 lodash.snakecase: 4.1.1 @@ -3146,7 +3146,7 @@ snapshots: dependencies: graceful-fs: 4.2.10 - '@pnpm/npm-conf@2.2.2': + '@pnpm/npm-conf@2.3.0': dependencies: '@pnpm/config.env-replace': 1.1.0 '@pnpm/network.ca-file': 1.0.2 @@ -3213,14 +3213,14 @@ snapshots: '@types/mdurl@2.0.0': {} - '@types/node@22.0.2': + '@types/node@22.1.0': dependencies: - undici-types: 6.11.1 + undici-types: 6.13.0 '@types/request@2.48.12': dependencies: '@types/caseless': 0.12.5 - '@types/node': 22.0.2 + '@types/node': 22.1.0 '@types/tough-cookie': 4.0.5 form-data: 2.5.1 @@ -4154,7 +4154,7 @@ snapshots: universal-analytics: 0.5.3 update-notifier-cjs: 5.1.6(encoding@0.1.13) uuid: 8.3.2 - winston: 3.13.1 + winston: 3.14.0 winston-transport: 4.7.1 ws: 7.5.10 yaml: 2.5.0 @@ -4167,7 +4167,7 @@ snapshots: fn.name@1.1.0: {} - foreground-child@3.2.1: + foreground-child@3.3.0: dependencies: cross-spawn: 7.0.3 signal-exit: 4.1.0 @@ -4270,7 +4270,7 @@ snapshots: glob@10.4.5: dependencies: - foreground-child: 3.2.1 + foreground-child: 3.3.0 jackspeak: 3.4.3 minimatch: 9.0.5 minipass: 7.1.2 @@ -4293,7 +4293,7 @@ snapshots: - encoding - supports-color - google-gax@4.3.8(encoding@0.1.13): + google-gax@4.3.9(encoding@0.1.13): dependencies: '@grpc/grpc-js': 1.11.1 '@grpc/proto-loader': 0.7.13 @@ -4456,7 +4456,7 @@ snapshots: entities: 4.5.0 param-case: 3.0.4 relateurl: 0.2.7 - terser: 5.31.3 + terser: 5.31.5 htmlparser2@7.2.0: dependencies: @@ -4821,7 +4821,7 @@ snapshots: lru-cache@7.18.3: {} - luxon@3.4.4: {} + luxon@3.5.0: {} make-dir@3.1.0: dependencies: @@ -5351,7 +5351,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 22.0.2 + '@types/node': 22.1.0 long: 5.2.3 proxy-addr@2.0.7: @@ -5469,7 +5469,7 @@ snapshots: registry-auth-token@5.0.2: dependencies: - '@pnpm/npm-conf': 2.2.2 + '@pnpm/npm-conf': 2.3.0 registry-url@5.1.0: dependencies: @@ -5813,7 +5813,7 @@ snapshots: - encoding - supports-color - terser@5.31.3: + terser@5.31.5: dependencies: '@jridgewell/source-map': 0.3.6 acorn: 8.12.1 @@ -5873,7 +5873,7 @@ snapshots: uc.micro@2.1.0: {} - undici-types@6.11.1: {} + undici-types@6.13.0: {} unicode-emoji-modifier-base@1.0.0: {} @@ -6025,7 +6025,7 @@ snapshots: readable-stream: 3.6.2 triple-beam: 1.4.1 - winston@3.13.1: + winston@3.14.0: dependencies: '@colors/colors': 1.6.0 '@dabh/diagnostics': 2.0.3 From aa44bf2faef6f35ed255914780d1aa27fcd60a61 Mon Sep 17 00:00:00 2001 From: Andrew Brogdon Date: Fri, 9 Aug 2024 10:11:09 -0700 Subject: [PATCH 09/57] Adds new roles to the jobs page. (#11025) This adds five new open roles to the jobs page at https://docs.flutter.dev/jobs. **Staged:** https://flutter-docs-prod--pr11025-jobs-ss2k17c7.web.app/jobs --- src/content/jobs/eng_mgr_denmark.md | 74 +++++++++++++++++++++++++++ src/content/jobs/index.md | 23 +++++---- src/content/jobs/senior_swe.md | 78 ++++++++++++++++++++++++++++ src/content/jobs/senior_swe_mgr.md | 78 ++++++++++++++++++++++++++++ src/content/jobs/swe_iii.md | 79 +++++++++++++++++++++++++++++ src/content/jobs/swe_manager_ii.md | 77 ++++++++++++++++++++++++++++ 6 files changed, 398 insertions(+), 11 deletions(-) create mode 100644 src/content/jobs/eng_mgr_denmark.md create mode 100644 src/content/jobs/senior_swe.md create mode 100644 src/content/jobs/senior_swe_mgr.md create mode 100644 src/content/jobs/swe_iii.md create mode 100644 src/content/jobs/swe_manager_ii.md diff --git a/src/content/jobs/eng_mgr_denmark.md b/src/content/jobs/eng_mgr_denmark.md new file mode 100644 index 0000000000..77f9810e3a --- /dev/null +++ b/src/content/jobs/eng_mgr_denmark.md @@ -0,0 +1,74 @@ +--- +title: Engineering Manager, Dart +short-title: Open manager role +description: Learn about and apply to this role! +toc: false +--- + +## About the position + +Like Google's own ambitions, the work of a Software Engineer goes beyond just Search. Software Engineering Managers have not only the technical expertise to take on and provide technical leadership to major projects, but also manage a team of Engineers. You not only optimize your own code but make sure Engineers are able to optimize theirs. As a Software Engineering Manager you manage your project goals, contribute to product strategy and help develop your team. Teams work all across the company, in areas such as information retrieval, artificial intelligence, natural language processing, distributed computing, large-scale system design, networking, security, data compression, user interface design; the list goes on and is growing every day. Operating with scale and speed, our exceptional software engineers are just getting started -- and as a manager, you guide the way. + +With technical and leadership expertise, you manage engineers across multiple teams and locations, a large product budget and oversee the deployment of large-scale projects across multiple sites internationally. + +## Our values + +### Mentorship + +Upon joining Google, you will be paired with a formal mentor, +who will help guide you in the process of ramping up, forging relationships, +and learning the systems you'll need to do your job. +Your manager can also help you find mentors who can coach you +as you navigate your career at Google. In addition to formal mentors, +we work and train together so that we are always learning from one another, +and we celebrate and support the career progression of our team members. + +### Inclusion + +Here on the Flutter team and at Google, we embrace our differences +and are [committed to furthering our culture of inclusion](https://flutter.dev/culture). +In addition to groups like the [Flutteristas](https://flutteristas.org/), +[Employee Resource Groups (ERGs)](https://diversity.google/commitments/) +are employee-initiated networks for supporting underrepresented employees +and their allies with shared values of creating belonging +across their communities and Google. + +### Work-Life Balance + +Our team also puts a high value on work-life balance. +Striking a healthy balance between your personal and professional life +is crucial to your happiness and success here, which is why we aren't focused +on how many hours you spend at work or online. Instead, +we're happy to offer a flexible schedule so you can have a more productive and +well-balanced life—both in and outside of work. + +## Job location + +Aarhus, Denmark + +## Job responsibilities + +* Set and communicate team priorities that support the broader organization's goals. Align strategy, processes, and decision-making across teams. +* Set clear expectations with individuals based on their level and role and aligned to the broader organization's goals. Meet regularly with individuals to discuss performance and development and provide feedback and coaching. +* Develop the mid-term technical outlook and roadmap within the scope of your (often multiple) team(s). Evolve the roadmap to meet anticipated future requirements and infrastructure needs. +* Design, guide, and vet systems designs within the scope of the broader area, and write product or system development code to solve ambiguous problems. +* Review code developed by other engineers and provide feedback to ensure best practices (e.g., style guidelines, checking code in, accuracy, testability, and efficiency). + +## Qualifications + +### Minimum qualifications + +* Bachelor’s degree, or equivalent practical experience. +* 8 years of experience with software development in one or more programming languages (e.g., Python, C, C++, Java, JavaScript). +* 3 years of experience in a technical leadership role; overseeing + projects, with 2 years of experience in a people management, + supervision/team leadership role. + +### Preferred qualifications + +* Master's degree or PhD in Computer Science or related technical field. +* 5 years of experience working in a complex, matrixed organization. + +## To apply + +Please apply via [this Google Careers page](https://www.google.com/about/careers/applications/jobs/results/90752708964688582-engineering-manager). diff --git a/src/content/jobs/index.md b/src/content/jobs/index.md index 048176b647..12dba3d26f 100644 --- a/src/content/jobs/index.md +++ b/src/content/jobs/index.md @@ -1,23 +1,24 @@ --- title: Flutter and Dart team job openings -short-title: Flutter team jobs +short-title: Open jobs description: Open job listings for the Flutter and Dart teams. --- ## Current openings -* [DRE based in mainland China](/jobs/dre-china) +#### Mainland China +* [Developer Relations Engineer](/jobs/dre-china) + +#### Mexico City, Mexico +* [Software Engineer III](/jobs/swe_iii) +* [Senior Software Engineer](/jobs/senior_swe) +* [Software Engineering Manager II](/jobs/swe_manager_ii) +* [Senior Software Engineering Manager](/jobs/senior_swe_mgr) + +#### Viby, Denmark +* [Software Engineering Manager, Dart](/jobs/eng_mgr_denmark) {% comment %} The Flutter and Dart SWE teams aren't currently hiring. Thanks for your interest! - -We are hiring on the Flutter and Dart teams! -The following jobs are open: - -## Software Engineering - -* [Android Engineer](/jobs/android) -* [Android Technical Lead](/jobs/android_tl) -* [iOS Engineer](/jobs/ios) {% endcomment %} diff --git a/src/content/jobs/senior_swe.md b/src/content/jobs/senior_swe.md new file mode 100644 index 0000000000..326042631c --- /dev/null +++ b/src/content/jobs/senior_swe.md @@ -0,0 +1,78 @@ +--- +title: Senior Software Engineer, Flutter +short-title: Open SWE role +description: Learn about and apply to this role! +toc: false +--- + +## About the position + +Google's software engineers develop the next-generation technologies that change how billions of users connect, explore, and interact with information and one another. Our products need to handle information at massive scale, and extend well beyond web search. We're looking for engineers who bring fresh ideas from all areas, including information retrieval, distributed computing, large-scale system design, networking and data storage, security, artificial intelligence, natural language processing, UI design and mobile; the list goes on and is growing every day. As a software engineer, you will work on a specific project critical to Google’s needs with opportunities to switch teams and projects as you and our fast-paced business grow and evolve. We need our engineers to be versatile, display leadership qualities and be enthusiastic to take on new problems across the full-stack as we continue to push technology forward. + +In this role, you will manage project priorities, deadlines, and deliverables. You will design, develop, test, deploy, maintain, and enhance software solutions. + +The Core team builds the technical foundation behind Google’s flagship products. We are owners and advocates for the underlying design elements, developer platforms, product components, and infrastructure at Google. These are the essential building blocks for excellent, safe, and coherent experiences for our users and drive the pace of innovation for every developer. We look across Google’s products to build central solutions, break down technical barriers and strengthen existing systems. As the Core team, we have a mandate and a unique opportunity to impact important technical decisions across the company. + +## Our values + +### Mentorship + +Upon joining Google, you will be paired with a formal mentor, +who will help guide you in the process of ramping up, forging relationships, +and learning the systems you'll need to do your job. +Your manager can also help you find mentors who can coach you +as you navigate your career at Google. In addition to formal mentors, +we work and train together so that we are always learning from one another, +and we celebrate and support the career progression of our team members. + +### Inclusion + +Here on the Flutter team and at Google, we embrace our differences +and are [committed to furthering our culture of inclusion](https://flutter.dev/culture). +In addition to groups like the [Flutteristas](https://flutteristas.org/), +[Employee Resource Groups (ERGs)](https://diversity.google/commitments/) +are employee-initiated networks for supporting underrepresented employees +and their allies with shared values of creating belonging +across their communities and Google. + +### Work-Life Balance + +Our team also puts a high value on work-life balance. +Striking a healthy balance between your personal and professional life +is crucial to your happiness and success here, which is why we aren't focused +on how many hours you spend at work or online. Instead, +we're happy to offer a flexible schedule so you can have a more productive and +well-balanced life—both in and outside of work. + +## Job location + +Mexico City, CDMX, Mexico + +## Job responsibilities + +* Write and test product or system development code. +* Participate in, or lead design reviews with peers and stakeholders to decide amongst available technologies. +* Review code developed by other developers and provide feedback to ensure best practices (e.g., style guidelines, checking code in, accuracy, testability, and efficiency). +* Contribute to existing documentation or educational content and adapt content based on product/program updates and user feedback. +* Triage product or system issues and debug/track/resolve by analyzing the sources of issues and the impact on hardware, network, or service operations and quality. + +## Qualifications + +### Minimum qualifications + +* Bachelor’s degree or equivalent practical experience. +* 5 years of experience with software development in one or more programming languages, and with data structures/algorithms. +* 3 years of experience testing, maintaining, or launching software products, and 1 year of experience with software design and architecture. +* Experience in mobile development. + +### Preferred qualifications + +* Master's degree or PhD in Computer Science, or a related technical field. +* 1 year of experience in a technical leadership role. +* Experience in front-end coding tools and languages (e.g., Javascript/Typescript, Flutter, Dart, Angular). +* Experience in back-end coding languages (e.g., GoLang, Rust, or Java). +* Experience in Machine learning (ML) model coding languages (e.g., Python) + +## To apply + +Please apply via [this Google Careers page](https://www.google.com/about/careers/applications/jobs/results/139595052358738630). diff --git a/src/content/jobs/senior_swe_mgr.md b/src/content/jobs/senior_swe_mgr.md new file mode 100644 index 0000000000..e1c3e94b7b --- /dev/null +++ b/src/content/jobs/senior_swe_mgr.md @@ -0,0 +1,78 @@ +--- +title: Senior Software Engineering Manager, Core +short-title: Open manager role +description: Learn about and apply to this role! +toc: false +--- + +## About the position + +Like Google's own ambitions, the work of a Software Engineer goes beyond just Search. Software Engineering Managers have not only the technical expertise to take on and provide technical leadership to major projects, but also manage a team of Engineers. You not only optimize your own code but make sure Engineers are able to optimize theirs. As a Software Engineering Manager you manage your project goals, contribute to product strategy and help develop your team. Teams work all across the company, in areas such as information retrieval, artificial intelligence, natural language processing, distributed computing, large-scale system design, networking, security, data compression, user interface design; the list goes on and is growing every day. Operating with scale and speed, our exceptional software engineers are just getting started -- and as a manager, you guide the way. + +With technical and leadership expertise, you manage engineers across multiple teams and locations, a large product budget and oversee the deployment of large-scale projects across multiple sites internationally. + +We empower developers to build multi-platform, full-stack applications and services augmented by AI using technologies such as Firebase, Project IDX, Checks, Gemini and Google Cloud Services. We look beyond the horizon, across all of Google’s products, to forge central solutions that dismantle technical barriers and enhance system robustness. We have some of the most vibrant and active Open Source communities in the world, such as Go, Flutter, and Dart, which help us innovate and deliver value to professional developers and enterprises across the globe. +The Core team builds the technical foundation behind Google’s flagship products. We are owners and advocates for the underlying design elements, developer platforms, product components, and infrastructure at Google. These are the essential building blocks for excellent, safe, and coherent experiences for our users and drive the pace of innovation for every developer. We look across Google’s products to build central solutions, break down technical barriers and strengthen existing systems. As the Core team, we have a mandate and a unique opportunity to impact important technical decisions across the company. + +## Our values + +### Mentorship + +Upon joining Google, you will be paired with a formal mentor, +who will help guide you in the process of ramping up, forging relationships, +and learning the systems you'll need to do your job. +Your manager can also help you find mentors who can coach you +as you navigate your career at Google. In addition to formal mentors, +we work and train together so that we are always learning from one another, +and we celebrate and support the career progression of our team members. + +### Inclusion + +Here on the Flutter team and at Google, we embrace our differences +and are [committed to furthering our culture of inclusion](https://flutter.dev/culture). +In addition to groups like the [Flutteristas](https://flutteristas.org/), +[Employee Resource Groups (ERGs)](https://diversity.google/commitments/) +are employee-initiated networks for supporting underrepresented employees +and their allies with shared values of creating belonging +across their communities and Google. + +### Work-Life Balance + +Our team also puts a high value on work-life balance. +Striking a healthy balance between your personal and professional life +is crucial to your happiness and success here, which is why we aren't focused +on how many hours you spend at work or online. Instead, +we're happy to offer a flexible schedule so you can have a more productive and +well-balanced life—both in and outside of work. + +## Job location + +Mexico City, CDMX, Mexico + +## Job responsibilities + +* Set and communicate team priorities that support the broader organization's goals. Align strategy, processes, and decision-making across teams. +* Set clear expectations with individuals based on their level and role and aligned to the broader organization's goals. Meet regularly with individuals to discuss performance and development and provide feedback and coaching. +* Develop the long-term technical goal and roadmap within, and often beyond, the scope of the teams. Evolve the roadmap to meet anticipated future requirements and infrastructure needs. +* Oversee systems designs within the scope of the broader area, and review product or system development code to solve ambiguous problems. +* Review code developed by other engineers and provide feedback to ensure best practices (e.g., style guidelines, checking code in, accuracy, testability, and efficiency). + +## Qualifications + +### Minimum qualifications + +* Bachelor's degree or equivalent practical experience. +* 8 years of experience with software development in one or more programming languages (e.g., Python, C, C++, Java, JavaScript). +* 5 years of experience in a technical leadership role; overseeing projects, with 5 years of experience in a people management, supervision/team leadership role. + +### Preferred qualifications + +* Master's degree or PhD in Computer Science or related technical field. +* 5 years of experience working in a complex, matrixed organization. +* Experience delivering developer tools, languages, AI Agents and ML models. +* Experience in building and deploying full-stack applications and servers. +* Experience in developer focused products aimed at improving developer productivity. + +## To apply + +Please apply via [this Google Careers page](https://www.google.com/about/careers/applications/jobs/results/119322545533919942). diff --git a/src/content/jobs/swe_iii.md b/src/content/jobs/swe_iii.md new file mode 100644 index 0000000000..3975dbb24d --- /dev/null +++ b/src/content/jobs/swe_iii.md @@ -0,0 +1,79 @@ +--- +title: Software Engineer III, Flutter (on mobile) +short-title: Open SWE role +description: Learn about and apply to this role! +toc: false +--- + +## About the position + +Google's software engineers develop the next-generation technologies that change how billions of users connect, explore, and interact with information and one another. Our products need to handle information at massive scale, and extend well beyond web search. We're looking for engineers who bring fresh ideas from all areas, including information retrieval, distributed computing, large-scale system design, networking and data storage, security, artificial intelligence, natural language processing, UI design and mobile; the list goes on and is growing every day. As a software engineer, you will work on a specific project critical to Google’s needs with opportunities to switch teams and projects as you and our fast-paced business grow and evolve. We need our engineers to be versatile, display leadership qualities and be enthusiastic to take on new problems across the full-stack as we continue to push technology forward. + +In this role, you will manage project priorities, deadlines, and deliverables. You will design, develop, test, deploy, maintain, and enhance software solutions. + +The Core team builds the technical foundation behind Google’s flagship products. We are owners and advocates for the underlying design elements, developer platforms, product components, and infrastructure at Google. These are the essential building blocks for excellent, safe, and coherent experiences for our users and drive the pace of innovation for every developer. We look across Google’s products to build central solutions, break down technical barriers and strengthen existing systems. As the Core team, we have a mandate and a unique opportunity to impact important technical decisions across the company. + +## Our values + +### Mentorship + +Upon joining Google, you will be paired with a formal mentor, +who will help guide you in the process of ramping up, forging relationships, +and learning the systems you'll need to do your job. +Your manager can also help you find mentors who can coach you +as you navigate your career at Google. In addition to formal mentors, +we work and train together so that we are always learning from one another, +and we celebrate and support the career progression of our team members. + +### Inclusion + +Here on the Flutter team and at Google, we embrace our differences +and are [committed to furthering our culture of inclusion](https://flutter.dev/culture). +In addition to groups like the [Flutteristas](https://flutteristas.org/), +[Employee Resource Groups (ERGs)](https://diversity.google/commitments/) +are employee-initiated networks for supporting underrepresented employees +and their allies with shared values of creating belonging +across their communities and Google. + +### Work-Life Balance + +Our team also puts a high value on work-life balance. +Striking a healthy balance between your personal and professional life +is crucial to your happiness and success here, which is why we aren't focused +on how many hours you spend at work or online. Instead, +we're happy to offer a flexible schedule so you can have a more productive and +well-balanced life—both in and outside of work. + +## Job location + +Mexico City, CDMX, Mexico + +## Job responsibilities + +* Design and build language and frameworks components to assist both Google and external developers build multi-platform applications. +* Collaborate closely with cross-functional partners in user research, design, and product to understand educators needs and to translate them into the right technical decisions and systems. +* Contribute to a diverse and inclusive team culture. + +## Qualifications + +### Minimum qualifications + +* Bachelor’s degree or equivalent practical experience. +* 2 years of experience with software development in one or more programming languages, or 1 year of experience with an advanced degree. +* 2 years of experience with data structures or algorithms. +* Experience in mobile application development. +* Experience with Android application development. +* Experience with iOS application development. + +### Preferred qualifications + +* Master's degree or PhD in Computer Science, or a related technical field. +* 1 year of experience in a technical leadership role. +* Experience coding in Java, Go, Rust, or Python. +* Experience in front-end coding tools and languages (e.g., Javascript/Typescript, Flutter, Dart, Angular). +* Experience developing accessible technologies. +* Ability to work well in a cross-functional team environment. + +## To apply + +Please apply via [this Google Careers page](https://www.google.com/about/careers/applications/jobs/results/91316052444488390). diff --git a/src/content/jobs/swe_manager_ii.md b/src/content/jobs/swe_manager_ii.md new file mode 100644 index 0000000000..81f42a2b5c --- /dev/null +++ b/src/content/jobs/swe_manager_ii.md @@ -0,0 +1,77 @@ +--- +title: Software Engineering Manager II, Flutter Engineering Productivity +short-title: Open manager role +description: Learn about and apply to this role! +toc: false +--- + +## About the position + +Like Google's own ambitions, the work of a Software Engineer goes beyond just Search. Software Engineering Managers have not only the technical expertise to take on and provide technical leadership to major projects, but also manage a team of Engineers. You not only optimize your own code but make sure Engineers are able to optimize theirs. As a Software Engineering Manager you manage your project goals, contribute to product strategy and help develop your team. Teams work all across the company, in areas such as information retrieval, artificial intelligence, natural language processing, distributed computing, large-scale system design, networking, security, data compression, user interface design; the list goes on and is growing every day. Operating with scale and speed, our exceptional software engineers are just getting started -- and as a manager, you guide the way. + +With technical and leadership expertise, you manage engineers across multiple teams and locations, a large product budget and oversee the deployment of large-scale projects across multiple sites internationally. + +The Core team builds the technical foundation behind Google’s flagship products. We are owners and advocates for the underlying design elements, developer platforms, product components, and infrastructure at Google. These are the essential building blocks for excellent, safe, and coherent experiences for our users and drive the pace of innovation for every developer. We look across Google’s products to build central solutions, break down technical barriers and strengthen existing systems. As the Core team, we have a mandate and a unique opportunity to impact important technical decisions across the company. + +## Our values + +### Mentorship + +Upon joining Google, you will be paired with a formal mentor, +who will help guide you in the process of ramping up, forging relationships, +and learning the systems you'll need to do your job. +Your manager can also help you find mentors who can coach you +as you navigate your career at Google. In addition to formal mentors, +we work and train together so that we are always learning from one another, +and we celebrate and support the career progression of our team members. + +### Inclusion + +Here on the Flutter team and at Google, we embrace our differences +and are [committed to furthering our culture of inclusion](https://flutter.dev/culture). +In addition to groups like the [Flutteristas](https://flutteristas.org/), +[Employee Resource Groups (ERGs)](https://diversity.google/commitments/) +are employee-initiated networks for supporting underrepresented employees +and their allies with shared values of creating belonging +across their communities and Google. + +### Work-Life Balance + +Our team also puts a high value on work-life balance. +Striking a healthy balance between your personal and professional life +is crucial to your happiness and success here, which is why we aren't focused +on how many hours you spend at work or online. Instead, +we're happy to offer a flexible schedule so you can have a more productive and +well-balanced life—both in and outside of work. + +## Job location + +Mexico City, CDMX, Mexico + +## Job responsibilities + +* Set and communicate team priorities that support the broader organization's goals. Align strategy, processes, and decision-making across teams. +* Set clear expectations with individuals based on their level and role and aligned to the broader organization's goals. Meet regularly with individuals to discuss performance and development and provide feedback and coaching. +* Develop the mid-term technical goal and roadmap within the scope of the teams. Evolve the roadmap to meet anticipated future requirements and infrastructure needs. +* Design, guide and vet systems designs within the scope of the broader area, and write product or system development code to solve ambiguous problems. +* Review code developed by other engineers and provide feedback to ensure best practices (e.g., style guidelines, checking code in, accuracy, testability, and efficiency). + + +## Qualifications + +### Minimum qualifications + +* Bachelor's degree or equivalent practical experience. +* 8 years of experience with software development in one or more programming languages (e.g., Python, C, C++, Java, JavaScript). +* 3 years of experience in a technical leadership role; overseeing projects, with 2 years of experience in a people management, supervision team leadership role. + +### Preferred qualifications + +* Experience in building and deploying full-stack applications and servers. +* Experience in developer focused products aimed at improving developer productivity. +* Experience working with cross-organization large engineering teams. +* Experience delivering developer tools, languages, AI Agents and Machine Learning (ML) models. + +## To apply + +Please apply via this [Google Careers page](https://www.google.com/about/careers/applications/jobs/results/83236711349265094). From 1224988cb967d6e3ac40518939d8253b41c0ee18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Sharma?= <737941+loic-sharma@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:52:56 -0700 Subject: [PATCH 10/57] Fix incorrect SwiftPM plugin migration step (#11029) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was caught by @brianquinlan while migrating the `cupertino_http` plugin. Review URL: https://flutter-docs-prod--pr11029-brian-feedback-9wffzaxo.web.app/packages-and-plugins/swift-package-manager/for-plugin-authors#how-to-add-swift-package-manager-support-to-an-existing-flutter-plugin Part of: https://github.com/dart-lang/http/issues/1276#issuecomment-2274503918 ## Presubmit checklist - [x] This PR is marked as draft with an explanation if not meant to land until a future stable release. - [x] This PR doesn’t contain automatically generated corrections (Grammarly or similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. --- .../docs/swift-package-manager/migrate-objective-c-plugin.md | 3 ++- .../docs/swift-package-manager/migrate-swift-plugin.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md b/src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md index 0333275a1b..bd8508a893 100644 --- a/src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md +++ b/src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md @@ -225,7 +225,8 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. If you would like to use a custom `modulemap` with your Swift package, refer to [Swift Package Manager's documentation][]. -1. Move all remaining files from `ios/Classes` to `ios/Sources/plugin_name`. +1. Move all remaining files from `ios/Classes` to + `ios/plugin_name/Sources/plugin_name`. 1. The `ios/Assets`, `ios/Resources`, and `ios/Classes` directories should now be empty and can be deleted. diff --git a/src/_includes/docs/swift-package-manager/migrate-swift-plugin.md b/src/_includes/docs/swift-package-manager/migrate-swift-plugin.md index 518ebff267..9afcdbd31f 100644 --- a/src/_includes/docs/swift-package-manager/migrate-swift-plugin.md +++ b/src/_includes/docs/swift-package-manager/migrate-swift-plugin.md @@ -157,7 +157,7 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. For more instructions, see [https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package](https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package). -1. Move all files from `ios/Classes` to `ios/Sources/plugin_name`. +1. Move all files from `ios/Classes` to `ios/plugin_name/Sources/plugin_name`. 1. The `ios/Assets`, `ios/Resources`, and `ios/Classes` directories should now be empty and can be deleted. From df19ef8b158558d10e2c3c233334a4193d5ec789 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 13 Aug 2024 09:40:47 +0200 Subject: [PATCH 11/57] Separate out design systems in widget catalogue (#11032) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _Description of what this PR is changing or adding, and why:_ Separate out design systems from other widgets in the widget catalogue _Issues fixed by this PR (if any):_ Contributes to https://github.com/flutter/website/issues/11024 ## Presubmit checklist - [ ] This PR is marked as draft with an explanation if not meant to land until a future stable release. - [x] This PR doesn’t contain automatically generated corrections (Grammarly or similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. --------- Co-authored-by: Brett Morgan --- src/content/ui/widgets/index.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/content/ui/widgets/index.md b/src/content/ui/widgets/index.md index a7e9fbbea4..5dbe728bc7 100644 --- a/src/content/ui/widgets/index.md +++ b/src/content/ui/widgets/index.md @@ -9,10 +9,38 @@ Create beautiful apps faster with Flutter's collection of visual, structural, platform, and interactive widgets. In addition to browsing widgets by category, you can also see all the widgets in the [widget index][]. +## Design systems + +Flutter ships with two design systems as part of the SDK. +You can find many more designs systems created by the Flutter community +on [pub.dev]({{site.pub}}), the package repository for Dart and Flutter. + +
+{% assign categories = catalog.index | sort: 'name' -%} +{% for section in categories %} + {%- if section.name == "Cupertino" or section.name == "Material components" -%} +
+
+
{{section.name}}
+

{{section.description}}

+
+ +
+ {% endif -%} +{% endfor %} +
+ +## Base widgets + +Base widgets support a range of common rendering options +like input, layout, and text. +
{% assign categories = catalog.index | sort: 'name' -%} {% for section in categories %} - {%- if section.name != "Material 2 components" -%} + {%- if section.name != "Cupertino" and section.name != "Material components" and section.name != "Material 2 components" -%}
{{section.name}}
From 904a6f7e82310f49212f618e30565058cb2865b1 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Tue, 13 Aug 2024 04:53:25 -0500 Subject: [PATCH 12/57] Fix CI Dart format check (#11027) If a multiple of 10 files (10, 20, 250, etc.) was formatted, this check accidentally allowed that and didn't fail on CI. --- tool/flutter_site/lib/src/commands/format_dart.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/flutter_site/lib/src/commands/format_dart.dart b/tool/flutter_site/lib/src/commands/format_dart.dart index 25a4100623..91f6bd8fd2 100644 --- a/tool/flutter_site/lib/src/commands/format_dart.dart +++ b/tool/flutter_site/lib/src/commands/format_dart.dart @@ -65,7 +65,7 @@ int formatDart({bool justCheck = false}) { } // If just checking formatting, exit with error code if any files changed. - if (justCheck && !normalOutput.contains('0 changed')) { + if (justCheck && !normalOutput.contains('(0 changed)')) { stderr.writeln('Error: Some files needed to be formatted!'); return 1; } From a341c79f45ddd3a55542719c1ae0c114add5eef6 Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Tue, 13 Aug 2024 02:54:08 -0700 Subject: [PATCH 13/57] Add `AnnotatedString` design doc redirect (#11036) Design doc: https://docs.google.com/document/d/18NRf-ziYvPCLr2xFoUqfRtanfZysrUvLAUz-BM_D2Ac --- firebase.json | 1 + 1 file changed, 1 insertion(+) diff --git a/firebase.json b/firebase.json index f8a92120dc..380efae253 100644 --- a/firebase.json +++ b/firebase.json @@ -573,6 +573,7 @@ { "source": "/go/static-tooling-in-devtools", "destination": "https://docs.google.com/document/d/1i6ISzzSKKDiiVftTnkCCvdgXEjK2eqYlPjCOKTjnvx8/edit?resourcekey=0-uyAiZEjFplyibsAkDAqKJw#", "type": 301 }, { "source": "/go/strategy-2022", "destination": "https://docs.google.com/document/d/e/2PACX-1vTI9X2XHN_IY8wDO4epQSD1CkRT8WDxf2CEExp5Ef4Id206UOMopkYqU73FvAnnYG6NAecNSDo9TaEO/pub", "type": 301 }, { "source": "/go/strategy-2023", "destination": "https://docs.google.com/document/d/e/2PACX-1vRknZ4Jkc-pWSMsDDyKwMrry7k2BSL_I94JCCQrg8FiHuy4fcypkgIVFbQVKPmzDQHfd20uZf2rFiXP/pub", "type": 301 }, + { "source": "/go/string-annotation", "destination": "https://docs.google.com/document/d/18NRf-ziYvPCLr2xFoUqfRtanfZysrUvLAUz-BM_D2Ac", "type": 301 }, { "source": "/go/studio-rasterization-context-for-multi-view", "destination": "https://docs.google.com/document/d/1Eqb8xeoRKpLq2OVkJX_ux3azVLGJgJcaY5uSWzqdc_4/edit", "type": 301 }, { "source": "/go/subpixel-antialiasing", "destination": "https://docs.google.com/document/d/1yEycgo5ivZ_lu2MAnMBLreZvROFdamy9-9q-QvMvL9U/edit?usp=sharing", "type": 301 }, { "source": "/go/supporting-dart-callbacks", "destination": "https://docs.google.com/document/d/1k7OimxbxXzdv3U7-TfB88yG5hIScN3TH6Jcvdcl4izM/edit", "type": 301 }, From e0064fc805c1dcf6876ba15689f77d54214edc61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 04:32:41 -0500 Subject: [PATCH 14/57] Bump examples/codelabs from `11bbf40` to `642d89a` (#11043) --- examples/codelabs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/codelabs b/examples/codelabs index 11bbf40040..642d89a562 160000 --- a/examples/codelabs +++ b/examples/codelabs @@ -1 +1 @@ -Subproject commit 11bbf400406b20d2e2fa8e336416079bec7252fc +Subproject commit 642d89a5629f2e8486dab7289781458f174f67ee From 75dd523a287c0fc794684a6c5d0002a394a58a8c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:33:18 +0200 Subject: [PATCH 15/57] Bump github/codeql-action from 3.26.0 to 3.26.1 (#11042) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.0 to 3.26.1.
Commits
  • 29d86d2 Merge pull request #2422 from github/update-v3.26.1-0d5982aa3
  • 5b15b9e Revert "Merge pull request #2417 from github/update-bundle/codeql-bundle-v2.1...
  • 18ac79e Update changelog for v3.26.1
  • 0d5982a Merge pull request #2416 from github/henrymercer/ghes-3.14-compat-info
  • da9ecb0 Merge pull request #2421 from github/henrymercer/log-job-run-uuid
  • c4c3c44 Merge pull request #2417 from github/update-bundle/codeql-bundle-v2.18.2
  • 41833c7 Log job run UUID
  • d620faa Bump the npm group with 4 updates (#2419)
  • 25ad3c8 Merge pull request #2418 from github/henrymercer/extraction-time-telemetry
  • 44ecae4 Fix matrixing of "submit SARIF after failure" check
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github/codeql-action&package-manager=github_actions&previous-version=3.26.0&new-version=3.26.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/scorecards-analysis.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ec8215e8d2..b331e602f8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -33,7 +33,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa + uses: github/codeql-action/init@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -44,7 +44,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa + uses: github/codeql-action/autobuild@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -58,4 +58,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa + uses: github/codeql-action/analyze@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 67541f3fc6..2782df8757 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -50,6 +50,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa + uses: github/codeql-action/upload-sarif@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 with: sarif_file: results.sarif From b98f19ee7b1e07a61fd8f0237c910303cb83c812 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Wed, 14 Aug 2024 23:44:39 +0200 Subject: [PATCH 16/57] Add some indicator that site is building (#11030) This isn't a perfect solution as it doesn't provide progress updates, but it will at least indicate to the command runner that the command is working and might take a while. If I have time in the future, I can revisit this to be more robust. Also adds a verbose flag to the `serve` command to get 11ty debug output. Resolves https://github.com/flutter/website/issues/11011 --- tool/flutter_site/lib/src/commands/build.dart | 2 ++ tool/flutter_site/lib/src/commands/serve.dart | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tool/flutter_site/lib/src/commands/build.dart b/tool/flutter_site/lib/src/commands/build.dart index 90d59e4dc9..c229f7097a 100644 --- a/tool/flutter_site/lib/src/commands/build.dart +++ b/tool/flutter_site/lib/src/commands/build.dart @@ -28,6 +28,8 @@ final class BuildSiteCommand extends Command { @override Future run() async { + print('Building site. This might take awhile...'); + final productionRelease = argResults.get(_releaseFlag, false); final process = await Process.start( diff --git a/tool/flutter_site/lib/src/commands/serve.dart b/tool/flutter_site/lib/src/commands/serve.dart index 4c36443075..185566d02e 100644 --- a/tool/flutter_site/lib/src/commands/serve.dart +++ b/tool/flutter_site/lib/src/commands/serve.dart @@ -6,7 +6,19 @@ import 'dart:io'; import 'package:args/command_runner.dart'; +import '../utils.dart'; + final class ServeSiteCommand extends Command { + static const String _verboseFlag = 'verbose'; + + ServeSiteCommand() { + argParser.addFlag( + _verboseFlag, + defaultsTo: false, + help: 'Show verbose logging.', + ); + } + @override String get description => 'Serve the site locally.'; @@ -15,11 +27,15 @@ final class ServeSiteCommand extends Command { @override Future run() async { + print('Building and serving site. This might take awhile...'); + + final verbose = argResults.get(_verboseFlag, false); final process = await Process.start( 'npx', const ['eleventy', '--serve', '--incremental'], - environment: const { + environment: { 'PRODUCTION': 'false', + if (verbose) 'DEBUG': 'Eleventy*', }, runInShell: true, mode: ProcessStartMode.inheritStdio, From 7aff2ee3bef6d2ea8314f740907988e8e8b247a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:32:32 +0200 Subject: [PATCH 17/57] Bump github/codeql-action from 3.26.1 to 3.26.2 (#11048) --- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/scorecards-analysis.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b331e602f8..ec0ca4612d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -33,7 +33,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 + uses: github/codeql-action/init@429e1977040da7a23b6822b13c129cd1ba93dbb2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -44,7 +44,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 + uses: github/codeql-action/autobuild@429e1977040da7a23b6822b13c129cd1ba93dbb2 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -58,4 +58,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 + uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2 diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 2782df8757..6fb3652e5e 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -50,6 +50,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@29d86d22a34ea372b1bbf3b2dced2e25ca6b3384 + uses: github/codeql-action/upload-sarif@429e1977040da7a23b6822b13c129cd1ba93dbb2 with: sarif_file: results.sarif From 126e5f0e417515f5c5f8ba3b8c6eaa20e43a742b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 12:33:23 +0200 Subject: [PATCH 18/57] Bump examples/codelabs from `642d89a` to `5983ed0` (#11047) --- examples/codelabs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/codelabs b/examples/codelabs index 642d89a562..5983ed0b79 160000 --- a/examples/codelabs +++ b/examples/codelabs @@ -1 +1 @@ -Subproject commit 642d89a5629f2e8486dab7289781458f174f67ee +Subproject commit 5983ed0b799deb234d74eb32591695cf6f8a7d11 From 242b2c226d6ee2d87187b7948a53ea7d06447a6d Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Fri, 16 Aug 2024 07:32:37 +0900 Subject: [PATCH 19/57] fix: Corrected path notation in iOS (#11020) https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-plugin-authors, I found a typo in the file path notation in the text. Since the correct path was obvious from the context of the text, a corrected PR was created. Co-authored-by: Parker Lougheed --- .../migrate-objective-c-plugin.md | 37 ++++++++++--------- .../migrate-swift-plugin.md | 8 ++-- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md b/src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md index bd8508a893..fc8d68cf9f 100644 --- a/src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md +++ b/src/_includes/docs/swift-package-manager/migrate-objective-c-plugin.md @@ -148,8 +148,8 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. ::: 1. If your plugin has a [`PrivacyInfo.xcprivacy` file][], move it to - `ios/Sources/plugin_name/PrivacyInfo.xcprivacy` and uncomment the resource in - the `Package.swift` file. + `ios/plugin_name/Sources/plugin_name/PrivacyInfo.xcprivacy` and uncomment + the resource in the `Package.swift` file. ```swift title="Package.swift" resources: [ @@ -166,14 +166,14 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. ], ``` -1. Move any resource files from `ios/Assets` to `ios/Sources/plugin_name` - (or a subdirectory). +1. Move any resource files from `ios/Assets` to + `ios/plugin_name/Sources/plugin_name` (or a subdirectory). Add the resource files to your `Package.swift` file, if applicable. For more instructions, see [https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package](https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package). 1. Move any public headers from `ios/Classes` to - `ios/Sources/plugin_name/include/plugin_name`. + `ios/plugin_name/Sources/plugin_name/include/plugin_name`. * If you're unsure which headers are public, check your `podspec` file's [`public_header_files`][] attribute. @@ -196,7 +196,7 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. `Package.swift` file. The example below assumes the `modulemap` and umbrella header are located - in the `ios/Sources/plugin_name/include` directory. + in the `ios/plugin_name/Sources/plugin_name/include` directory. ```diff2html --- a/Package.swift @@ -247,8 +247,8 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. * After:
-     ios/plugin_name_ios/Sources/plugin_name_ios/
-     └── include/plugin_name_ios/
+     ios/plugin_name/Sources/plugin_name/
+     └── include/plugin_name/
         └── PublicHeaderFile.h
      └── ImplementationFile.m
      
@@ -257,11 +257,11 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. should be updated: ```diff2html - --- a/Sources/plugin_name_ios/ImplementationFile.m - +++ b/Sources/plugin_name_ios/ImplementationFile.m + --- a/Sources/plugin_name/ImplementationFile.m + +++ b/Sources/plugin_name/ImplementationFile.m @@ -1,1 +1,1 @@ - #import "PublicHeaderFile.h" - + #import "./include/plugin_name_ios/PublicHeaderFile.h" + + #import "./include/plugin_name/PublicHeaderFile.h" ``` 1. If your plugin uses [Pigeon][], update your Pigeon input file. @@ -273,8 +273,8 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. javaOptions: JavaOptions(), - objcHeaderOut: 'ios/Classes/messages.g.h', - objcSourceOut: 'ios/Classes/messages.g.m', - + objcHeaderOut: 'ios/plugin_name_ios/Sources/plugin_name_ios/messages.g.h', - + objcSourceOut: 'ios/plugin_name_ios/Sources/plugin_name_ios/messages.g.m', + + objcHeaderOut: 'ios/plugin_name/Sources/plugin_name/messages.g.h', + + objcSourceOut: 'ios/plugin_name/Sources/plugin_name/messages.g.m', copyrightHeader: 'pigeons/copyright.txt', ``` @@ -289,10 +289,10 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. javaOptions: JavaOptions(), - objcHeaderOut: 'ios/Classes/messages.g.h', - objcSourceOut: 'ios/Classes/messages.g.m', - + objcHeaderOut: 'ios/plugin_name_ios/Sources/plugin_name_ios/include/plugin_name_ios/messages.g.h', - + objcSourceOut: 'ios/plugin_name_ios/Sources/plugin_name_ios/messages.g.m', + + objcHeaderOut: 'ios/plugin_name/Sources/plugin_name/include/plugin_name/messages.g.h', + + objcSourceOut: 'ios/plugin_name/Sources/plugin_name/messages.g.m', + objcOptions: ObjcOptions( - + headerIncludePath: './include/plugin_name_ios/messages.g.h', + + headerIncludePath: './include/plugin_name/messages.g.h', + ), copyrightHeader: 'pigeons/copyright.txt', ``` @@ -371,8 +371,9 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. Otherwise, using `SWIFTPM_MODULE_BUNDLE` results in an error. ::: -1. If your `ios/Sources/plugin_name/include` directory only contains a - `.gitkeep`, you'll want update your `.gitignore` to include the following: +1. If your `ios/plugin_name/Sources/plugin_name/include` directory only + contains a `.gitkeep`, you'll want update your `.gitignore` to include the + following: ```text title=".gitignore" !.gitkeep diff --git a/src/_includes/docs/swift-package-manager/migrate-swift-plugin.md b/src/_includes/docs/swift-package-manager/migrate-swift-plugin.md index 9afcdbd31f..fa51ef8467 100644 --- a/src/_includes/docs/swift-package-manager/migrate-swift-plugin.md +++ b/src/_includes/docs/swift-package-manager/migrate-swift-plugin.md @@ -133,8 +133,8 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. ::: 1. If your plugin has a [`PrivacyInfo.xcprivacy` file][], move it to - `ios/Sources/plugin_name/PrivacyInfo.xcprivacy` and uncomment the resource in - the `Package.swift` file. + `ios/plugin_name/Sources/plugin_name/PrivacyInfo.xcprivacy` and uncomment + the resource in the `Package.swift` file. ```swift title="Package.swift" resources: [ @@ -151,8 +151,8 @@ The example below uses `ios`, replace `ios` with `macos`/`darwin` as applicable. ], ``` -1. Move any resource files from `ios/Assets` to `ios/Sources/plugin_name` - (or a subdirectory). +1. Move any resource files from `ios/Assets` to + `ios/plugin_name/Sources/plugin_name` (or a subdirectory). Add the resource files to your `Package.swift` file, if applicable. For more instructions, see [https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package](https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package). From 2384e5d8a10fe85d95a4851817448886417ef235 Mon Sep 17 00:00:00 2001 From: Yegor Date: Thu, 15 Aug 2024 20:09:23 -0700 Subject: [PATCH 20/57] [web] update web renderer documentation (#11045) _Description of what this PR is changing or adding, and why:_ The `--web-renderer` option has been deprecated and hidden (see https://github.com/flutter/flutter/pull/152683). This updates the docs to reflect the new reality. --- src/content/deployment/web.md | 45 ++--- .../platform-integration/web/building.md | 5 +- .../web/initialization-legacy.md | 2 +- .../web/initialization.md | 14 +- .../platform-integration/web/renderers.md | 155 ++++++++++++------ src/content/platform-integration/web/wasm.md | 16 +- 6 files changed, 136 insertions(+), 101 deletions(-) diff --git a/src/content/deployment/web.md b/src/content/deployment/web.md index fda14d12cf..a88d78a774 100644 --- a/src/content/deployment/web.md +++ b/src/content/deployment/web.md @@ -16,21 +16,16 @@ of your app and covers the following topics: * [Deploying to the web](#deploying-to-the-web) * [Deploying to Firebase Hosting](#deploying-to-firebase-hosting) * [Handling images on the web](#handling-images-on-the-web) -* [Choosing a web renderer](#choosing-a-web-renderer) +* [Choosing a build mode and a renderer](#choosing-a-build-mode-and-a-renderer) * [Minification](#minification) ## Building the app for release -Build the app for deployment using the -`flutter build web` command. -You can also choose which renderer to use -by using the `--web-renderer` option (See [Web renderers][]). -This generates the app, including the assets, -and places the files into the `/build/web` -directory of the project. +Build the app for deployment using the `flutter build web` command. This +generates the app, including the assets, and places the files into the +`/build/web` directory of the project. -The release build of a simple app has the -following structure: +The release build of a simple app has the following structure: ```plaintext /build/web @@ -51,9 +46,7 @@ following structure: canvaskit canvaskit.js canvaskit.wasm - profiling - canvaskit.js - canvaskit.wasm + favicon.png flutter.js flutter_service_worker.js @@ -63,11 +56,6 @@ following structure: version.json ``` -:::note -The `canvaskit` directory and its contents are only present when the -CanvasKit renderer is selected—not when the HTML renderer is selected. -::: - Launch a web server (for example, `python -m http.server 8000`, or by using the [dhttpd][] package), @@ -89,10 +77,12 @@ many others: * [Google Cloud Hosting][] ## Deploying to Firebase Hosting + You can use the Firebase CLI to build and release your Flutter app with Firebase Hosting. ### Before you begin + To get started, [install or update][install-firebase-cli] the Firebase CLI: ```console @@ -145,20 +135,19 @@ This limits what you can do with images compared to mobile and desktop platforms For more information, see [Displaying images on the web][]. -## Choosing a web renderer +## Choosing a build mode and a renderer -By default, the `flutter build` and `flutter run` commands -use the `auto` choice for the web renderer. This means that -your app runs with the HTML renderer on mobile browsers and -CanvasKit on desktop browsers. We recommend this combination -to optimize for the characteristics of each platform. +Flutter web provides two build modes (default and WebAssembly) and two renderers +(`canvaskit` and `skwasm`). For more information, see [Web renderers][]. ## Minification -Minification is handled for you when you -create a release build. +To improve app start-up the compiler reduces the size of the compiled code by +removing unused code (known as _tree shaking_), and by renaming code symbols to +shorter strings (e.g. by renaming `AlignmentGeometryTween` to something like +`ab`). Which of these two optimizations are applied depends on the build mode: | Type of web app build | Code minified? | Tree shaking performed? | |-----------------------|----------------|-------------------------| @@ -180,8 +169,8 @@ Flutter-based PWAs can be installed in the same way as any other web-based PWA; the settings signaling that your Flutter app is a PWA are provided by `manifest.json`, which is produced by `flutter create` in the `web` directory. -PWA support remains a work in progress, -so please [give us feedback][] if you see something that doesn't look right. +PWA support remains a work in progress. Please [give us feedback][] if you see +something that doesn't work as expected. [dhttpd]: {{site.pub}}/packages/dhttpd [Displaying images on the web]: /platform-integration/web/web-images diff --git a/src/content/platform-integration/web/building.md b/src/content/platform-integration/web/building.md index 9c58168ff3..f424851d78 100644 --- a/src/content/platform-integration/web/building.md +++ b/src/content/platform-integration/web/building.md @@ -140,9 +140,8 @@ This populates a `build/web` directory with built files, including an `assets` directory, which need to be served together. -You can also include `--web-renderer html` or `--web-renderer canvaskit` to -select between the HTML or CanvasKit renderers, respectively. For more -information, see [Web renderers][]. +Flutter web offers multiple build modes and renderers. For more information, +see [Web renderers][]. To learn more, see [Build and release a web app][]. diff --git a/src/content/platform-integration/web/initialization-legacy.md b/src/content/platform-integration/web/initialization-legacy.md index 09c5835091..958f3f0c4f 100644 --- a/src/content/platform-integration/web/initialization-legacy.md +++ b/src/content/platform-integration/web/initialization-legacy.md @@ -134,7 +134,7 @@ You can add any of the following optional parameters: |`canvasKitMaximumSurfaces`| The maximum number of overlay surfaces that the CanvasKit renderer can use. |`double`| |`debugShowSemanticNodes`| If `true`, Flutter visibly renders the semantics tree onscreen (for debugging). |`bool`| |`hostElement`| HTML Element into which Flutter renders the app. When not set, Flutter web takes over the whole page. |`HtmlElement`| -|`renderer`| Specifies the [web renderer][web-renderers] for the current Flutter application, either `"canvaskit"` or `"html"`. |`String`| +|`renderer`| Specifies the [web renderer][web-renderers] for the current Flutter application, either `"canvaskit"` or `"skwasm"`. |`String`| {:.table} diff --git a/src/content/platform-integration/web/initialization.md b/src/content/platform-integration/web/initialization.md index 13a78148b8..300595cb6a 100644 --- a/src/content/platform-integration/web/initialization.md +++ b/src/content/platform-integration/web/initialization.md @@ -95,7 +95,7 @@ order to successfully start your Flutter app: * A `{% raw %}{{flutter_js}}{% endraw %}` token, to make `_flutter.loader` available. -* A `{% raw %}{{flutter_build_config}}{% endraw %}` token, +* A `{% raw %}{{flutter_build_config}}{% endraw %}` token, which provides information about the build to the `FlutterLoader` needed to start your app. * A call to `_flutter.loader.load()`, which actually starts the app. @@ -133,7 +133,7 @@ The `config` argument is an object that can have the following optional fields: |`canvasKitMaximumSurfaces`| The maximum number of overlay surfaces that the CanvasKit renderer can use. |`double`| |`debugShowSemanticNodes`| If `true`, Flutter visibly renders the semantics tree onscreen (for debugging). |`bool`| |`hostElement`| HTML Element into which Flutter renders the app. When not set, Flutter web takes over the whole page. |`HtmlElement`| -|`renderer`| Specifies the [web renderer][web-renderers] for the current Flutter application, either `"canvaskit"` or `"html"`. |`String`| +|`renderer`| Specifies the [web renderer][web-renderers] for the current Flutter application, either `"canvaskit"` or `"skwasm"`. |`String`| {:.table} @@ -152,16 +152,16 @@ The `serviceWorkerSettings` argument has the following optional fields. ## Example: Customizing Flutter configuration based on URL query parameters The following example shows a custom `flutter_bootstrap.js` that allows -the user to force the app to use the `CanvasKit` renderer by providing -a query parameter called `?force_canvaskit=true` in the URL of their website: +the user to select a renderer by providing a `renderer` query parameter, +e.g. `?renderer=skwasm`, in the URL of their website: ```js {% raw %}{{flutter_js}}{% endraw %} {% raw %}{{flutter_build_config}}{% endraw %} const searchParams = new URLSearchParams(window.location.search); -const forceCanvaskit = searchParams.get('force_canvaskit') === 'true'; -const userConfig = forceCanvaskit ? {'renderer': 'canvaskit'} : {}; +const renderer = searchParams.get('renderer'); +const userConfig = renderer ? {'renderer': renderer} : {}; _flutter.loader.load({ config: userConfig, serviceWorkerSettings: { @@ -171,7 +171,7 @@ _flutter.loader.load({ ``` This script evaluates the `URLSearchParams` of the page to determine whether -the user passed `force_canvaskit=true` and then +the user passed a `renderer` query parameter and then changes the user configuration of the Flutter app. It also passes the service worker settings to use the flutter service worker, along with the service worker version. diff --git a/src/content/platform-integration/web/renderers.md b/src/content/platform-integration/web/renderers.md index 813bcab5c8..c8c019d208 100644 --- a/src/content/platform-integration/web/renderers.md +++ b/src/content/platform-integration/web/renderers.md @@ -1,69 +1,98 @@ --- title: Web renderers -description: How to choose a web renderer for running and building a web app. +description: Choosing build modes and renderers for a Flutter web app. --- -When running and building apps for the web, you can choose between two different -renderers. This page describes both renderers and how to choose the best one for -your needs. The two renderers are: +Flutter web offers two _build modes_, and two _renderers_. A build mode +is chosen when building the app and it determines which of the two renderers are +available in the app, and how a renderer is chosen. A renderer is chosen at +runtime when the app is being launched, and it determines the set of web +technologies used to render the UI. -**CanvasKit renderer** -: This renderer is fully consistent with Flutter mobile and desktop, has faster - performance with higher widget density, but adds about 1.5MB in download size. - [CanvasKit][canvaskit] uses WebGL to render Skia paint commands. +The two build modes are: default mode, and WebAssembly mode. -**HTML renderer** -: This renderer, which has a smaller download size than the CanvasKit renderer, - uses a combination of HTML elements, CSS, Canvas elements, and SVG elements. +The two renderers are: `canvaskit` and `skwasm`. -## Command line options +## Renderers -The `--web-renderer` command line option takes one of three values: -`canvaskit`, `html`, or `auto`. +Rendering UI in Flutter begins in the framework with widgets and render objects. +Once processed, render objects generate a `Scene` object made of layers. The +scene is then passed to the Flutter _engine_ that turns it into pixels. All of +the framework, including all widgets and custom app code, and much of the engine +are written in Dart. However, a big part of the engine is written in C++, which +includes Skia, as well as custom Flutter engine code. Multiple options are +available on the web for how to compile Dart and C++, what graphics system to +use to convert UI into pixels, how to split the workload across threads, etc. -* `canvaskit` (default) - always use the CanvasKit renderer -* `html` - always use the HTML renderer -* `auto` - automatically chooses which renderer to use. This option - chooses the HTML renderer when the app is running in a mobile browser, and - CanvasKit renderer when the app is running in a desktop browser. +Flutter web does not offer all possible combinations of options. Instead, it +provides just two bundles of carefully chosen combinations. -This flag can be used with the `run` or `build` subcommands. For example: +### canvaskit -```console -flutter run -d chrome --web-renderer html -``` +When using the `canvaskit` renderer, the Dart code is compiled to JavaScript, +and the UI is rendered on the main thread into WebGL. It is compatible with all +modern browsers. It includes a copy of Skia compiled to WebAssembly, which adds +about 1.5MB in download size. -```console -flutter build web --web-renderer canvaskit -``` +### skwasm + +When using `skwasm` the Dart code is compiled to WebAssembly. Additionally, if +the hosting server meets the [SharedArrayBuffer security requirements][], +Flutter will use a dedicated [web worker][] to offload part of the rendering +workload to a separate thread, taking advantage of multiple CPU cores. This +renderer includes a more compact version of Skia compiled to WebAssembly, adding +about 1.1MB in download size. + +## Build modes + +### Default build mode -This flag is ignored when a non-browser (mobile or desktop) device -target is selected. +The default mode is used when `flutter run` and `flutter build web` commands are +used without passing `--wasm` or by passing `--no-wasm`. This build mode only +uses the `canvaskit` renderer. -## Runtime configuration +### WebAssembly build mode -To override the web renderer at runtime: +This mode is enabled by passing `--wasm` to `flutter run` and +`flutter build web` commands. - 1. Build the app with the `auto` option. - 1. Set up custom web app initialization - as described in [Write a custom `flutter_bootstrap.js`][custom-bootstrap]. +This mode makes both `skwasm` and `canvaskit` available. `skwasm` requires +[wasm garbage collection][], which is not yet supported by all modern browsers. +Therefore, at runtime Flutter will pick `skwasm` if garbage collection is +supported, and fallback to `canvaskit` if not. This allows apps compiled in the +WebAssembly mode to still run in all modern browsers. + +The `--wasm` flag is not supported by non-web platforms. + +## Choosing a renderer at runtime + +By default, when building in WebAssembly mode, Flutter will decide when to +use `skwasm`, and when to fallback to `canvaskit`. This can be overridden by +passing a configuration object to the loader, as follows: + + 1. Build the app with the `--wasm` flag to make both `skwasm` and `canvaskit` + renderers available to the app. + 1. Set up custom web app initialization as described in + [Write a custom `flutter_bootstrap.js`][custom-bootstrap]. 1. Prepare a configuration object with the `renderer` property set to - `"canvaskit"` or `"html"`. + `"canvaskit"` or `"skwasm"`. 1. Pass your prepared config object as the `config` property of a new object to the `_flutter.loader.load` method that is provided by the earlier injected code. +Example: + ```html highlightLines=9-14 diff --git a/src/_sass/components/_code.scss b/src/_sass/components/_code.scss index 92ea4bfa56..d8fad141e0 100644 --- a/src/_sass/components/_code.scss +++ b/src/_sass/components/_code.scss @@ -43,6 +43,38 @@ pre { border-left-color: $site-color-primary; } + &.added-line, &.removed-line { + padding-left: 0.25rem; + + &::before { + display: inline-block; + user-select: none; + width: 0.75rem; + margin-right: 0.25rem; + text-align: right; + } + } + + &.added-line { + background: color.change($flutter-color-teal, $alpha: 0.03); + border-left-color: $flutter-color-teal; + + &::before { + content: '+'; + color: color.mix($site-color-sub-grey, $flutter-color-teal); + } + } + + &.removed-line { + background: color.change($alert-danger-fg, $alpha: 0.03); + border-left-color: $alert-danger-fg; + + &::before { + content: '-'; + color: color.mix($site-color-sub-grey, $alert-danger-fg); + } + } + .terminal-command::before { color: $site-color-sub-grey; content: "$"; @@ -191,6 +223,7 @@ pre { code { display: block; + min-width: fit-content; width: 100%; } diff --git a/src/content/codelabs/implicit-animations.md b/src/content/codelabs/implicit-animations.md index 13edafced7..c9d8109208 100644 --- a/src/content/codelabs/implicit-animations.md +++ b/src/content/codelabs/implicit-animations.md @@ -4,7 +4,6 @@ description: > Learn how to use Flutter's implicitly animated widgets through interactive examples and exercises. toc: true -diff2html: true js: - defer: true url: /assets/js/inject_dartpad.js @@ -83,30 +82,36 @@ To create a fade-in effect, you can animate the `opacity` property using the`AnimatedOpacity` widget. Wrap the `Column` widget in an `AnimatedOpacity` widget: -```diff2html ---- opacity1/lib/main.dart -+++ opacity2/lib/main.dart -@@ -26,12 +26,14 @@ - ), - onPressed: () => {}, - ), -- const Column( -- children: [ -- Text('Type: Owl'), -- Text('Age: 39'), -- Text('Employment: None'), -- ], -+ AnimatedOpacity( -+ child: const Column( -+ children: [ -+ Text('Type: Owl'), -+ Text('Age: 39'), -+ Text('Employment: None'), -+ ], -+ ), - ) - ]); - } +```dart diff + @override + Widget build(BuildContext context) { + return ListView(children: [ + Image.network(owlUrl), + TextButton( + child: const Text( + 'Show Details', + style: TextStyle(color: Colors.blueAccent), + ), + onPressed: () => {}, + ), +- const Column( +- children: [ +- Text('Type: Owl'), +- Text('Age: 39'), +- Text('Employment: None'), +- ], +- ), ++ AnimatedOpacity( ++ child: const Column( ++ children: [ ++ Text('Type: Owl'), ++ Text('Age: 39'), ++ Text('Employment: None'), ++ ], ++ ), ++ ), + ]); + } ``` :::note @@ -119,26 +124,17 @@ to make these changes in the [fade-in starter code][]. To hide the text before the user clicks **Show details**, set the starting value for `opacity` to zero: -```diff2html ---- opacity2/lib/main.dart -+++ opacity3/lib/main.dart -@@ -15,6 +15,8 @@ - } - - class _FadeInDemoState extends State { -+ double opacity = 0; -+ - @override - Widget build(BuildContext context) { - return ListView(children: [ -@@ -27,6 +29,7 @@ - onPressed: () => {}, - ), - AnimatedOpacity( -+ opacity: opacity, - child: const Column( - children: [ - Text('Type: Owl'), +```dart diff + class _FadeInDemoState extends State { ++ double opacity = 0; ++ + @override + Widget build(BuildContext context) { + return ListView(children: [ + // ... + AnimatedOpacity( ++ opacity: opacity, + child: const Column( ``` #### 3. Set the duration of the animation @@ -147,17 +143,11 @@ In addition to an `opacity` parameter, `AnimatedOpacity` requires a [duration][] to use for its animation. For this example, you can start with 2 seconds: -```diff2html ---- opacity3/lib/main.dart -+++ opacity4/lib/main.dart -@@ -29,6 +29,7 @@ - onPressed: () => {}, - ), - AnimatedOpacity( -+ duration: const Duration(seconds: 2), - opacity: opacity, - child: const Column( - children: [ +```dart diff + AnimatedOpacity( ++ duration: const Duration(seconds: 2), + opacity: opacity, + child: const Column( ``` #### 4. Set up a trigger for animation and choose an end value @@ -168,20 +158,17 @@ To do this, change `opacity` state using the `onPressed()` handler for the user clicks **Show details**, use the `onPressed()` handler to set `opacity` to 1: -```diff2html ---- opacity4/lib/main.dart -+++ opacity5/lib/main.dart -@@ -26,7 +26,9 @@ - 'Show Details', - style: TextStyle(color: Colors.blueAccent), - ), -- onPressed: () => {}, -+ onPressed: () => setState(() { -+ opacity = 1; -+ }), - ), - AnimatedOpacity( - duration: const Duration(seconds: 2), +```dart diff + TextButton( + child: const Text( + 'Show Details', + style: TextStyle(color: Colors.blueAccent), + ), +- onPressed: () => {}, ++ onPressed: () => setState(() { ++ opacity = 1; ++ }), + ), ``` :::note @@ -267,18 +254,19 @@ The following steps use the `AnimatedContainer` widget to: Change the `Container` widget to an `AnimatedContainer` widget: -```diff2html ---- container1/lib/main.dart -+++ container2/lib/main.dart -@@ -47,7 +47,7 @@ - SizedBox( - width: 128, - height: 128, -- child: Container( -+ child: AnimatedContainer( - margin: EdgeInsets.all(margin), - decoration: BoxDecoration( - color: color, +```dart diff + SizedBox( + width: 128, + height: 128, +- child: Container( ++ child: AnimatedContainer( + margin: EdgeInsets.all(margin), + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(borderRadius), + ), + ), + ), ``` :::note @@ -295,24 +283,18 @@ create a `change()` method. The `change()` method can use the `setState()` method to set new values for the `color`, `borderRadius`, and `margin` state variables: -```diff2html ---- container2/lib/main.dart -+++ container3/lib/main.dart -@@ -38,6 +38,14 @@ - margin = randomMargin(); - } - -+ void change() { -+ setState(() { -+ color = randomColor(); -+ borderRadius = randomBorderRadius(); -+ margin = randomMargin(); -+ }); -+ } +```dart diff ++ void change() { ++ setState(() { ++ color = randomColor(); ++ borderRadius = randomBorderRadius(); ++ margin = randomMargin(); ++ }); ++ } + - @override - Widget build(BuildContext context) { - return Scaffold( + @override + Widget build(BuildContext context) { + // ... ``` #### 3. Set up a trigger for the animation @@ -320,18 +302,12 @@ for the `color`, `borderRadius`, and `margin` state variables: To set the animation to trigger whenever the user presses **Change**, invoke the `change()` method in the `onPressed()` handler: -```diff2html ---- container3/lib/main.dart -+++ container4/lib/main.dart -@@ -65,7 +65,7 @@ - ), - ElevatedButton( - child: const Text('Change'), -- onPressed: () => {}, -+ onPressed: () => change(), - ), - ], - ), +```dart diff + ElevatedButton( + child: const Text('Change'), +- onPressed: () => {}, ++ onPressed: () => change(), + ), ``` #### 4. Set duration @@ -339,26 +315,19 @@ invoke the `change()` method in the `onPressed()` handler: Set the `duration` of the animation that powers the transition between the old and new values: -```diff2html ---- container4/lib/main.dart -+++ container5/lib/main.dart -@@ -6,6 +6,8 @@ - - import 'package:flutter/material.dart'; - -+const _duration = Duration(milliseconds: 400); -+ - double randomBorderRadius() { - return Random().nextDouble() * 64; - } -@@ -61,6 +63,7 @@ - color: color, - borderRadius: BorderRadius.circular(borderRadius), - ), -+ duration: _duration, - ), - ), - ElevatedButton( +```dart diff + SizedBox( + width: 128, + height: 128, + child: AnimatedContainer( + margin: EdgeInsets.all(margin), + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(borderRadius), + ), ++ duration: const Duration(milliseconds: 400), + ), + ), ``` ### Shape-shifting (complete) @@ -394,17 +363,20 @@ the [complete shape-shifting example][]. The animation changes when you pass the [`easeInOutBack`][] constant for `curve`, -```diff2html ---- container5/lib/main.dart -+++ container6/lib/main.dart -@@ -64,6 +64,7 @@ - borderRadius: BorderRadius.circular(borderRadius), - ), - duration: _duration, -+ curve: Curves.easeInOutBack, - ), - ), - ElevatedButton( +```dart diff + SizedBox( + width: 128, + height: 128, + child: AnimatedContainer( + margin: EdgeInsets.all(margin), + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(borderRadius), + ), + duration: _duration, ++ curve: Curves.easeInOutBack, + ), + ), ``` When you pass the `Curves.easeInOutBack` constant to the `curve` property diff --git a/src/content/cookbook/animation/physics-simulation.md b/src/content/cookbook/animation/physics-simulation.md index 817682965b..ebcf85be95 100644 --- a/src/content/cookbook/animation/physics-simulation.md +++ b/src/content/cookbook/animation/physics-simulation.md @@ -1,7 +1,6 @@ --- title: Animate a widget using a physics simulation description: How to implement a physics animation. -diff2html: true js: - defer: true url: /assets/js/inject_dartpad.js @@ -94,30 +93,24 @@ Extending `SingleTickerProviderStateMixin` allows the state object to be a documentation for [TickerProvider][]. ::: -```diff2html ---- lib/starter.dart -+++ lib/step1.dart -@@ -29,14 +29,20 @@ - State createState() => _DraggableCardState(); - } - --class _DraggableCardState extends State { -+class _DraggableCardState extends State -+ with SingleTickerProviderStateMixin { -+ late AnimationController _controller; +```dart diff +- class _DraggableCardState extends State { ++ class _DraggableCardState extends State ++ with SingleTickerProviderStateMixin { ++ late AnimationController _controller; + - @override - void initState() { - super.initState(); -+ _controller = -+ AnimationController(vsync: this, duration: const Duration(seconds: 1)); - } - - @override - void dispose() { -+ _controller.dispose(); - super.dispose(); - } + @override + void initState() { + super.initState(); ++ _controller = ++ AnimationController(vsync: this, duration: const Duration(seconds: 1)); + } + + @override + void dispose() { ++ _controller.dispose(); + super.dispose(); + } ``` ## Step 2: Move the widget using gestures @@ -125,14 +118,11 @@ documentation for [TickerProvider][]. Make the widget move when it's dragged, and add an [Alignment][] field to the `_DraggableCardState` class: -```diff2html ---- lib/step1.dart (alignment) -+++ lib/step2.dart (alignment) -@@ -1,3 +1,4 @@ - class _DraggableCardState extends State - with SingleTickerProviderStateMixin { - late AnimationController _controller; -+ Alignment _dragAlignment = Alignment.center; +```dart diff + class _DraggableCardState extends State + with SingleTickerProviderStateMixin { + late AnimationController _controller; ++ Alignment _dragAlignment = Alignment.center; ``` Add a [GestureDetector][] that handles the `onPanDown`, `onPanUpdate`, and @@ -141,35 +131,32 @@ size of the widget, and divide by 2. (This converts units of "pixels dragged" to coordinates that [Align][] uses.) Then, set the `Align` widget's `alignment` to `_dragAlignment`: -```diff2html ---- lib/step1.dart (build) -+++ lib/step2.dart (build) -@@ -1,8 +1,22 @@ - @override - Widget build(BuildContext context) { -- return Align( -- child: Card( -- child: widget.child, -+ var size = MediaQuery.of(context).size; -+ return GestureDetector( -+ onPanDown: (details) {}, -+ onPanUpdate: (details) { -+ setState(() { -+ _dragAlignment += Alignment( -+ details.delta.dx / (size.width / 2), -+ details.delta.dy / (size.height / 2), -+ ); -+ }); -+ }, -+ onPanEnd: (details) {}, -+ child: Align( -+ alignment: _dragAlignment, -+ child: Card( -+ child: widget.child, -+ ), - ), - ); - } +```dart diff + @override + Widget build(BuildContext context) { +- return Align( +- child: Card( +- child: widget.child, ++ var size = MediaQuery.of(context).size; ++ return GestureDetector( ++ onPanDown: (details) {}, ++ onPanUpdate: (details) { ++ setState(() { ++ _dragAlignment += Alignment( ++ details.delta.dx / (size.width / 2), ++ details.delta.dy / (size.height / 2), ++ ); ++ }); ++ }, ++ onPanEnd: (details) {}, ++ child: Align( ++ alignment: _dragAlignment, ++ child: Card( ++ child: widget.child, ++ ), + ), + ); + } ``` ## Step 3: Animate the widget @@ -180,15 +167,12 @@ Add an `Animation` field and an `_runAnimation` method. This method defines a `Tween` that interpolates between the point the widget was dragged to, to the point in the center. -```diff2html ---- lib/step2.dart (animation) -+++ lib/step3.dart (animation) -@@ -1,4 +1,5 @@ - class _DraggableCardState extends State - with SingleTickerProviderStateMixin { - late AnimationController _controller; -+ late Animation _animation; - Alignment _dragAlignment = Alignment.center; +```dart diff + class _DraggableCardState extends State + with SingleTickerProviderStateMixin { + late AnimationController _controller; ++ late Animation _animation; + Alignment _dragAlignment = Alignment.center; ``` @@ -208,19 +192,18 @@ void _runAnimation() { Next, update `_dragAlignment` when the `AnimationController` produces a value: -```diff2html ---- lib/step2.dart (init-state) -+++ lib/step3.dart (init-state) -@@ -3,4 +3,9 @@ - super.initState(); - _controller = - AnimationController(vsync: this, duration: const Duration(seconds: 1)); -+ _controller.addListener(() { -+ setState(() { -+ _dragAlignment = _animation.value; -+ }); -+ }); - } +```dart diff + @override + void initState() { + super.initState(); + _controller = + AnimationController(vsync: this, duration: const Duration(seconds: 1)); ++ _controller.addListener(() { ++ setState(() { ++ _dragAlignment = _animation.value; ++ }); ++ }); + } ``` Next, make the `Align` widget use the `_dragAlignment` field: @@ -237,29 +220,20 @@ child: Align( Finally, update the `GestureDetector` to manage the animation controller: -```diff2html ---- lib/step2.dart (gesture) -+++ lib/step3.dart (gesture) -@@ -1,5 +1,7 @@ - return GestureDetector( -- onPanDown: (details) {}, -+ onPanDown: (details) { -+ _controller.stop(); -+ }, - onPanUpdate: (details) { - setState(() { - _dragAlignment += Alignment( -@@ -8,7 +10,9 @@ - ); - }); - }, -- onPanEnd: (details) {}, -+ onPanEnd: (details) { -+ _runAnimation(); -+ }, - child: Align( - alignment: _dragAlignment, - child: Card( +```dart diff + return GestureDetector( +- onPanDown: (details) {}, ++ onPanDown: (details) { ++ _controller.stop(); ++ }, + onPanUpdate: (details) { + // ... + }, +- onPanEnd: (details) {}, ++ onPanEnd: (details) { ++ _runAnimation(); ++ }, + child: Align( ``` ## Step 4: Calculate the velocity to simulate a springing motion diff --git a/src/content/cookbook/gestures/dismissible.md b/src/content/cookbook/gestures/dismissible.md index 535ebf4e44..692f8ea38a 100644 --- a/src/content/cookbook/gestures/dismissible.md +++ b/src/content/cookbook/gestures/dismissible.md @@ -1,7 +1,6 @@ --- title: Implement swipe to dismiss description: How to implement swiping to dismiss or delete. -diff2html: true js: - defer: true url: /assets/js/inject_dartpad.js @@ -110,18 +109,15 @@ To add the indicator, provide a `background` parameter to the `Dismissible`. -```diff2html ---- lib/step2.dart (Dismissible) -+++ lib/main.dart (Dismissible) -@@ -16,6 +16,8 @@ - ScaffoldMessenger.of(context) - .showSnackBar(SnackBar(content: Text('$item dismissed'))); - }, -+ // Show a red background as the item is swiped away. -+ background: Container(color: Colors.red), - child: ListTile( - title: Text(item), - ), +```dart diff + ScaffoldMessenger.of(context) + .showSnackBar(SnackBar(content: Text('$item dismissed'))); + }, ++ // Show a red background as the item is swiped away. ++ background: Container(color: Colors.red), + child: ListTile( + title: Text(item), + ), ``` ## Interactive example diff --git a/src/content/cookbook/images/fading-in-images.md b/src/content/cookbook/images/fading-in-images.md index 580b6566fe..6faa4e29c3 100644 --- a/src/content/cookbook/images/fading-in-images.md +++ b/src/content/cookbook/images/fading-in-images.md @@ -78,10 +78,10 @@ You can also consider using local assets for placeholders. First, add the asset to the project's `pubspec.yaml` file (for more details, see [Adding assets and images][]): -```diff - flutter: - assets: -+ - assets/loading.gif +```yaml diff + flutter: + assets: ++ - assets/loading.gif ``` Then, use the [`FadeInImage.assetNetwork()`][] constructor: diff --git a/src/content/deployment/android.md b/src/content/deployment/android.md index f5a355d7a8..aaf31875bd 100644 --- a/src/content/deployment/android.md +++ b/src/content/deployment/android.md @@ -80,16 +80,16 @@ To find out the latest version, visit [Google Maven][]. 1. Set the light theme in `/android/app/src/main/res/values/styles.xml`: -```diff --