Skip to content

Commit 80c9a9f

Browse files
authored
sync docs, 2024/12/24
2 parents 15d8044 + 140c3a0 commit 80c9a9f

File tree

609 files changed

+10954
-4679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

609 files changed

+10954
-4679
lines changed

.github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3535
with:
3636
submodules: recursive
37-
- uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3
37+
- uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff
3838
with:
3939
channel: ${{ matrix.branch }}
4040
- name: Fetch Dart dependencies
@@ -58,7 +58,7 @@ jobs:
5858
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
5959
with:
6060
submodules: recursive
61-
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
61+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
6262
with:
6363
sdk: stable
6464
- name: Fetch Dart dependencies
@@ -86,7 +86,7 @@ jobs:
8686
run: corepack install
8787
- name: Install node dependencies
8888
run: pnpm install --frozen-lockfile
89-
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
89+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
9090
with:
9191
sdk: stable
9292
- name: Fetch Dart dependencies
@@ -109,7 +109,7 @@ jobs:
109109
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
110110
with:
111111
submodules: recursive
112-
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
112+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
113113
with:
114114
sdk: stable
115115
- name: Fetch Dart dependencies

.github/workflows/codeql-analysis.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches:
8+
- main
9+
10+
# Declare default permissions as read only.
11+
permissions: read-all
12+
13+
jobs:
14+
analyze:
15+
name: Analyze
16+
runs-on: ubuntu-latest
17+
if: github.repository == 'flutter/website'
18+
permissions:
19+
actions: read
20+
contents: read
21+
security-events: write
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
language: [ 'javascript' ]
27+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
28+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
33+
34+
# Initializes the CodeQL tools for scanning.
35+
- name: Initialize CodeQL
36+
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169
37+
with:
38+
languages: ${{ matrix.language }}
39+
# If you wish to specify custom queries, you can do so here or in a config file.
40+
# By default, queries listed here will override any specified in a config file.
41+
# Prefix the list here with "+" to use these queries and those in the config file.
42+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
44+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
45+
# If this step fails, then you should remove it and run the build manually (see below)
46+
- name: Autobuild
47+
uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169
48+
49+
# ℹ️ Command-line programs to run using the OS shell.
50+
# 📚 https://git.io/JvXDl
51+
52+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
53+
# and modify them (or add more) to build your code if your project
54+
# uses a compiled language
55+
56+
#- run: |
57+
# make bootstrap
58+
# make release
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169

.idx/dev.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# see: https://developers.google.com/idx/guides/customize-idx-env
33
{ pkgs, ... }: {
44
# Which nixpkgs channel to use.
5-
channel = "stable-24.05"; # or "unstable"
5+
channel = "stable-24.11"; # or "unstable"
66

77
# Use https://search.nixos.org/packages to find packages
88
packages = [

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ it's easiest to make changes using the GitHub UI.
4242
If you have an issue with the
4343
API docs on [api.flutter.dev](https://api.flutter.dev),
4444
please file those issues on
45-
the [flutter/flutter](https://github.com/flutter/flutter/issues) repo,
46-
not on this (flutter/website) repo.
45+
the [`flutter/flutter`](https://github.com/flutter/flutter/issues) repo,
46+
not on this (`flutter/website`) repo.
4747
The API docs are embedded in Flutter's source code,
4848
so the engineering team handles those.
4949

@@ -129,7 +129,7 @@ If you prefer, you can use a version manager such as [nvm][],
129129
and run `nvm install` from the repository's root directory.
130130

131131
If you already have Node installed, verify it's available on your path
132-
and already the latest stable version _(currently `20.17` or later)_:
132+
and already the latest stable version _(currently `22.12` or later)_:
133133

134134
```console
135135
node --version
@@ -200,7 +200,7 @@ following the instructions in [Get the prerequisites](#get-the-prerequisites).
200200
dart pub get
201201
```
202202

203-
3. (optional - We highly recommend you use `pnpm`, but you can also use `npm`.)
203+
3. _Optional:_ We recommend you use `pnpm`, but you can also use `npm`.
204204
Install `pnpm`, an alternative, efficient package manager for
205205
npm packages. If you already have `pnpm`, verify you have the
206206
latest stable version.
@@ -209,7 +209,7 @@ following the instructions in [Get the prerequisites](#get-the-prerequisites).
209209
node --version
210210
```
211211

212-
If you do not already have `pnpm` installed, we recommend
212+
If you don't already have `pnpm` installed, we recommend
213213
using [`corepack`][] to install and manage `pnpm` versions,
214214
since `corepack` is bundled with most installations of
215215
Node. If you installed `node` using Homebrew, you'll need
@@ -327,7 +327,7 @@ run `./dash_site refresh-excerpts`.
327327
To learn more about creating, editing, and using code excerpts,
328328
check out the [excerpt updater package documentation][].
329329

330-
[excerpt updater package documentation]: https://github.com/dart-lang/site-shared/tree/main/packages/excerpter#readme
330+
[excerpt updater package documentation]: https://github.com/dart-lang/site-shared/tree/main/pkgs/excerpter#readme
331331

332332
## [Optional] Deploy to a staging site
333333

@@ -360,7 +360,7 @@ you can build a full version and upload it to Firebase.
360360
./dash_site build
361361
```
362362

363-
This will build the site and copy it to your local `_site` directory.
363+
This builds the site and copies it to your local `_site` directory.
364364
If that directory previously existed, it will be replaced.
365365

366366
3. Deploy to your activated Firebase project's default hosting site:

analysis_options.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
analyzer:
2-
exclude: [flutter, site-shared, src, tmp]
2+
exclude: [_site, flutter, site-shared, src, tmp]

cloud_build/deploy.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
steps:
2+
- name: gcr.io/cloud-builders/git
3+
args: ['submodule', 'update', '--init', '--recursive']
4+
- name: gcr.io/cloud-builders/git
5+
args: ['fetch', '--unshallow']
6+
- name: gcr.io/flutter-dev-230821/firebase-ghcli
7+
# Set up, build, then deploy site to production
8+
entrypoint: '/bin/bash'
9+
args:
10+
- '-c'
11+
- |-
12+
set -e
13+
14+
npm install
15+
npm run build-site-for-production
16+
17+
firebase deploy --project=flutter-docs-prod --only=hosting
18+
options:
19+
logging: CLOUD_LOGGING_ONLY

cloud_build/stage.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
steps:
2+
- name: gcr.io/cloud-builders/git
3+
args: ['submodule', 'update', '--init', '--recursive']
4+
- name: gcr.io/flutter-dev-230821/firebase-ghcli
5+
# Set up, build, deploy site to staging, then comment link on PR
6+
entrypoint: '/bin/bash'
7+
args:
8+
- '-c'
9+
- |-
10+
set -e
11+
12+
npm install
13+
npm run build-site-for-staging
14+
15+
cloud_build/scripts/stage_site_and_comment_on_github.sh
16+
secretEnv: ['GH_PAT_TOKEN']
17+
env:
18+
- 'PR_NUMBER=$_PR_NUMBER'
19+
- 'HEAD_BRANCH=$_HEAD_BRANCH'
20+
- 'PROJECT_ID=$PROJECT_ID'
21+
- 'COMMIT_SHA=$COMMIT_SHA'
22+
- 'REPO_FULL_NAME=$REPO_FULL_NAME'
23+
availableSecrets:
24+
secretManager:
25+
- versionName: projects/$PROJECT_ID/secrets/flutter-website-bot-comment-pat/versions/latest
26+
env: 'GH_PAT_TOKEN'
27+
timeout: 1200s
28+
options:
29+
logging: CLOUD_LOGGING_ONLY

dash_site

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
REQUIRED_DART_VERSION="3.5"
4-
REQUIRED_NODE_VERSION="20.12"
5-
REQUIRED_PNPM_VERSION="9.0"
3+
REQUIRED_DART_VERSION="3.6"
4+
REQUIRED_NODE_VERSION="22.11"
5+
REQUIRED_PNPM_VERSION="9.12"
66

77
# Check that the 'dart' command is available on the user's path.
88
if ! command -v dart &> /dev/null; then
Binary file not shown.

eleventy.config.js eleventy.config.ts

+9-12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { registerFilters } from './src/_11ty/filters.js';
66
import { registerShortcodes } from './src/_11ty/shortcodes.js';
77
import { markdown } from './src/_11ty/plugins/markdown.js';
88
import { configureHighlighting } from './src/_11ty/plugins/highlight.js';
9+
import { UserConfig } from '@11ty/eleventy';
910

1011
import minifier from 'html-minifier-terser';
1112
import yaml from 'js-yaml';
@@ -15,13 +16,9 @@ import * as path from 'node:path';
1516
import * as sass from 'sass';
1617

1718
// noinspection JSUnusedGlobalSymbols
18-
/**
19-
* @typedef {import('11ty/eleventy/UserConfig')} EleventyConfig
20-
* @param {EleventyConfig} eleventyConfig
21-
*/
22-
export default function (eleventyConfig) {
23-
const isProduction = process.env.PRODUCTION === 'true';
24-
const shouldOptimize = process.env.OPTIMIZE === 'true';
19+
export default function (eleventyConfig: UserConfig) {
20+
const isProduction = process.env['PRODUCTION'] === 'true';
21+
const shouldOptimize = process.env['OPTIMIZE'] === 'true';
2522

2623
eleventyConfig.on('eleventy.before', async () => {
2724
await configureHighlighting(markdown);
@@ -31,8 +28,8 @@ export default function (eleventyConfig) {
3128

3229
eleventyConfig.setLibrary('md', markdown);
3330

34-
eleventyConfig.addDataExtension('yml,yaml', (contents) =>
35-
yaml.load(contents),
31+
eleventyConfig.addDataExtension('yml,yaml', (contents: string) =>
32+
yaml.load(contents),
3633
);
3734

3835
eleventyConfig.setLiquidOptions({
@@ -51,7 +48,7 @@ export default function (eleventyConfig) {
5148
eleventyConfig.addWatchTarget('src/_sass');
5249
eleventyConfig.addExtension('scss', {
5350
outputFileExtension: 'css',
54-
compile: function (inputContent, inputPath) {
51+
compile: function (inputContent: string, inputPath: string) {
5552
const parsedPath = path.parse(inputPath);
5653
if (parsedPath.name.startsWith('_')) {
5754
return;
@@ -88,13 +85,13 @@ export default function (eleventyConfig) {
8885
filter: /^(?!_).+/,
8986
});
9087
eleventyConfig.addPassthroughCopy('src/content/tools/devtools/release-notes', {
91-
filter: (path) => path.includes('src') || path.includes('images'),
88+
filter: (path: string) => path.includes('src') || path.includes('images'),
9289
});
9390

9491
if (shouldOptimize) {
9592
// If building for production, minify/optimize the HTML output.
9693
// Doing so during serving isn't worth the extra build time.
97-
eleventyConfig.addTransform('minify-html', async function (content) {
94+
eleventyConfig.addTransform('minify-html', async function (content: string) {
9895
if (this.page.outputPath && this.page.outputPath.endsWith('.html')) {
9996
// Minify the page's content if it's an HTML file.
10097
// Other options can be enabled, but each should be tested.

examples/_animation/basic_hero_animation/analysis_options.yaml

-5
This file was deleted.

examples/_animation/basic_hero_animation/pubspec.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ publish_to: none
33
description: >-
44
Shows how to create a simple or Hero animation using the Hero class directly.
55
6+
resolution: workspace
67
environment:
7-
sdk: ^3.5.0
8+
sdk: ^3.6.0
89

910
dependencies:
1011
flutter:
1112
sdk: flutter
1213

1314
dev_dependencies:
14-
example_utils:
15-
path: ../../example_utils
1615
flutter_test:
1716
sdk: flutter
1817

examples/_animation/basic_radial_hero_animation/analysis_options.yaml

-5
This file was deleted.

examples/_animation/basic_radial_hero_animation/lib/main.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Photo extends StatelessWidget {
2222
return Material(
2323
// Slightly opaque color appears where the image has transparency.
2424
// Makes it possible to see the radial transformation's boundary.
25-
color: Theme.of(context).primaryColor.withOpacity(0.25),
25+
color: Theme.of(context).primaryColor.withValues(alpha: 0.25),
2626
child: InkWell(
2727
onTap: onTap,
2828
child: Image.asset(

examples/_animation/basic_radial_hero_animation/pubspec.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ description: >-
44
Shows how to apply a radial transformation to the Hero
55
as it animates to the new route.
66
7+
resolution: workspace
78
environment:
8-
sdk: ^3.5.0
9+
sdk: ^3.6.0
910

1011
dependencies:
1112
flutter:
1213
sdk: flutter
1314

1415
dev_dependencies:
15-
example_utils:
16-
path: ../../example_utils
1716
flutter_test:
1817
sdk: flutter
1918

examples/_animation/basic_staggered_animation/analysis_options.yaml

-5
This file was deleted.

examples/_animation/basic_staggered_animation/lib/main.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ class _StaggerDemoState extends State<StaggerDemo>
187187
width: 300,
188188
height: 300,
189189
decoration: BoxDecoration(
190-
color: Colors.black.withOpacity(0.1),
190+
color: Colors.black.withValues(alpha: 0.1),
191191
border: Border.all(
192-
color: Colors.black.withOpacity(0.5),
192+
color: Colors.black.withValues(alpha: 0.5),
193193
),
194194
),
195195
child: StaggerAnimation(controller: _controller.view),

examples/_animation/basic_staggered_animation/pubspec.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ name: basic_staggered
22
publish_to: none
33
description: An introductory example to staggered animations.
44

5+
resolution: workspace
56
environment:
6-
sdk: ^3.5.0
7+
sdk: ^3.6.0
78

89
dependencies:
910
flutter:
1011
sdk: flutter
1112

1213
dev_dependencies:
13-
example_utils:
14-
path: ../../example_utils
1514
flutter_test:
1615
sdk: flutter
1716

examples/_animation/hero_animation/analysis_options.yaml

-5
This file was deleted.

0 commit comments

Comments
 (0)