Skip to content

Commit

Permalink
Merge branch 'main' into doc/src-ui-layout-responsive-building-adapti…
Browse files Browse the repository at this point in the history
…ve-apps
  • Loading branch information
AlexV525 authored Nov 27, 2023
2 parents a865aeb + a89b413 commit 2c84217
Show file tree
Hide file tree
Showing 61 changed files with 254 additions and 186 deletions.
53 changes: 27 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,30 @@ jobs:
run: make test
continue-on-error: ${{ matrix.experimental }}

# linkcheck:
# name: Build site and check links
# runs-on: ubuntu-latest
# if: ${{ github.ref != 'refs/heads/main' }}
# steps:
# - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
# with:
# submodules: recursive
# - name: Build site and check links
# run: make build BUILD_CONFIGS=_config.yml,_config_stage.yml
# - name: Install Node for Firebase install
# uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
# with:
# node-version: ${{ env.NODE_VERSION }}
# - name: Install Firebase CLI
# run: npm install -g [email protected]
# - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
# with:
# sdk: stable
# - run: tool/check-links.sh
linkcheck:
name: Build site and check links
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/main' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
submodules: recursive
- name: Build site and check links
run: make build BUILD_CONFIGS=_config.yml,_config_stage.yml
# - name: Install Node for Firebase install
# uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
# with:
# node-version: ${{ env.NODE_VERSION }}
# - name: Install Firebase CLI
# run: npm install -g [email protected]
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
with:
sdk: stable
- run: tool/check-links.sh

deploy:
name: Deploy to production
needs: test
needs: [test, linkcheck]
runs-on: ubuntu-latest
if: |
github.event_name == 'push'
Expand All @@ -82,12 +82,13 @@ jobs:
# with:
# node-version: ${{ env.NODE_VERSION }}
# - name: Install Firebase CLI
# run: npm install -g [email protected]
# run: npm install -g [email protected]
# - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
# with:
# sdk: stable
# - run: tool/check-links.sh
# - name: Deploy to Firebase hosting
# run: make deploy
# env:
# FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
# FIREBASE_ALIAS: default
# run: make deploy # TODO(drewroengoogle) Run deploy on Cloud Build.
- name: Deploy CN
run: make deploy
env:
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/link-check.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/no-response.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/stage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check links and stage
name: Stage site on Firebase

on:
pull_request:
Expand All @@ -20,9 +20,9 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
submodules: recursive
- name: Build site and check links
- name: Build site
run: make stage-local
- name: Stage site on Firebase
- name: Stage
if: ${{
github.repository == 'cfug/flutter.cn' &&
github.event.pull_request.user.login != 'dependabot[bot]' }}
Expand Down
6 changes: 0 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ RUN mkdir -p /etc/apt/keyrings \
&& apt-get install nodejs -yq \
&& npm install -g npm # Ensure latest npm

# Install global Firebase CLI
# RUN npm install -g [email protected]

# ============== FLUTTER CODE TESTS ==============
FROM flutter AS tests
Expand Down Expand Up @@ -136,7 +134,3 @@ ENV BUILD_CONFIGS=$BUILD_CONFIGS
# RUN bundle exec jekyll build --config $BUILD_CONFIGS

RUN tool/move_docs.sh; tool/translator/build.sh

FROM build AS checklinks

CMD ["tool/check-links.sh"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ serve:

# Test hosting locally with FB emulator
emulate:
make clean
firebase emulators:start --only hosting --project ${FIREBASE_ALIAS}


# =================== Build / Test / Deploy Commands ==================
Expand Down
10 changes: 5 additions & 5 deletions src/_includes/docs/run-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

Do _not_ test the performance of your app with debug and
hot reload enabled.

**请勿** 在调试模式和热重载功能开启的情况下做性能测试。

{{site.alert.end}}

So far you've been running your app in *debug* mode. Debug
Expand All @@ -27,12 +27,12 @@ build modes. For more details, see [Flutter's build modes][].
[Flutter 的构建模式选择]({{site.url}}/testing/build-modes)

{{site.alert.important}}

If you're concerned about the package size of your app,
see [Measuring your app's size][].

如果你关心应用大小,请参考 [这篇文档][Measuring your app's size]

{{site.alert.end}}

[Flutter's build modes]: {{site.url}}/testing/build-modes
Expand Down
2 changes: 1 addition & 1 deletion src/add-to-app/android/add-flutter-screen.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ is discussed next.
那么你的 Flutter 应用会像是运行在一个大小为零的窗口中,
直至 `FlutterEngine` 附属到一个 `FlutterActivity``FlutterFragment``FlutterView`
请确保你的应用在开始预热到你展示 Flutter 内容中间的这段时间里表现正常。

{{site.alert.end}}

With a pre-warmed, cached `FlutterEngine`, you now need
Expand Down
13 changes: 9 additions & 4 deletions src/add-to-app/ios/add-flutter-screen.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ To launch a Flutter screen from an existing iOS, you start a
`FlutterEngine` 充当 Dart VM 和 Flutter 运行时的主机;
`FlutterViewController` 依附于 `FlutterEngine`
给 Flutter 传递 UIKit 的输入事件,并展示被 `FlutterEngine` 渲染的每一帧画面。

{{site.alert.end}}

The `FlutterEngine` might have the same lifespan as your
Expand All @@ -59,13 +60,14 @@ The `FlutterEngine` might have the same lifespan as your
logic before showing the UI.

在展示 UI 前,你的应用和 plugins 可以与 Flutter 和 Dart 逻辑交互。

{{site.alert.end}}

See [Loading sequence and performance][]
for more analysis on the latency and memory
trade-offs of pre-warming an engine.

[加载顺序和性能]({{site.url}}/development/add-to-app/performance)
[加载顺序和性能][Loading sequence and performance]
里有更多关于预热 engine 的延迟和内存取舍的分析。

### Create a FlutterEngine
Expand Down Expand Up @@ -339,6 +341,7 @@ Now, you have a Flutter screen embedded in your iOS app.
在上一个例子中,你的默认 Dart 库的默认入口函数 `main()`,
将会在 `AppDelegate` 创建 `FlutterEngine` 并调用 `run` 方法时调用。
{{site.alert.end}}
### _Alternatively_ - Create a FlutterViewController with an implicit FlutterEngine
Expand Down Expand Up @@ -792,6 +795,7 @@ a different Dart function.
@pragma('vm:entry-point')
void myOtherEntrypoint() { ... };
```

{{site.alert.end}}

### Dart library
Expand Down Expand Up @@ -884,10 +888,11 @@ FlutterViewController* flutterViewController =
如果在 `FlutterEngine` 启动后,迫切得需要在平台侧改变你当前的 Flutter 路由,
可以使用 `FlutterViewController` 里的 [`pushRoute()`][] 或者 [`popRoute()`][]

To pop the iOS route from the Flutter side,
To pop the iOS route from the Flutter side,
call [`SystemNavigator.pop()`][].

在 Flutter 侧推出 iOS 路由,调用 [`SystemNavigator.pop()`][]

在 Flutter 侧推出 iOS 路由,调用 [`SystemNavigator.pop()`][]

{{site.alert.end}}

See [Navigation and routing][] for more about Flutter's routes.
Expand Down
1 change: 1 addition & 0 deletions src/androidx-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ keywords: AndoridX, Android Studio, Flutter 里使用 AndroidX
doesn't use AndroidX.

如果 Flutter 监测到你的项目中未使用到 AndroidX,那么你会跳转到此页面。

{{site.alert.end}}

[AndroidX]({{site.android-dev}}/jetpack/androidx) is a major improvement
Expand Down
7 changes: 4 additions & 3 deletions src/codelabs/layout-basics-old.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ toc: false
work in some browsers and not others. If you encounter any, please
[create a DartPad issue](https://goo.gle/flutter_web_issue),
labeling the issue with `platform-web`.

目前 codelab 是基于 Chrome 开发测试的。可能会有一些功能(短期内)在某些浏览器上可用,而在另一些浏览器上不可用。
如果您遇到任何问题,请 [create a DartPad issue](https://goo.gle/flutter_web_issue) ,并为这个 issue 加上
`platform-web` 标签。
如果您遇到任何问题,请 [create a DartPad issue](https://goo.gle/flutter_web_issue)
并为这个 issue 加上 `platform-web` 标签。

{{site.alert.end}}

`Row` and `Column` are two very important widgets in the Flutter universe.
Expand Down
10 changes: 7 additions & 3 deletions src/codelabs/layout-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ and `Column` lays out its widgets vertically.

{{site.alert.secondary}}
{:.no_toc}

The following example displays the differences between
a `Row` and `Column`.

Expand Down Expand Up @@ -1167,7 +1168,7 @@ wrap a widget and force the widget to fill extra space.
`Flexible` 非常相似。

{{site.alert.tip}}

**What's the difference between Flexible and Expanded?**
Use `Flexible` to resize widgets in a `Row` or `Column`.
That way, you can adjust a child widget's spacing
Expand All @@ -1193,7 +1194,7 @@ wrap a widget and force the widget to fill extra space.
The following example demonstrates how the
`Expanded` widget forces its child widget to
fill extra space.

下面的例子演示了 `Expanded` widget 是如何
强制其子 widget 填满空间的。

Expand All @@ -1214,6 +1215,7 @@ wrap a widget and force the widget to fill extra space.
and run again.

选择 **Format** 按钮格式化代码,然后再次运行。

{{site.alert.end}}

```run-dartpad:theme-dark:mode-flutter:width-100%:height-400px:split-60
Expand Down Expand Up @@ -1674,6 +1676,7 @@ can create space between widgets.
Use `Spacer` when you want to create space using a `flex` property.
Use `SizedBox` when you want to create space
using a specific number of logical pixels.

**SizedBox 和 Spacer 有何不同?**
如果你想用 `flex` 属性创建一段空间,请使用 `Spacer`
如果你想创建一个拥有特定逻辑像素值的空间,请使用 `SizedBox`
Expand Down Expand Up @@ -1840,7 +1843,7 @@ for different fonts, sizes, and colors.
{:.no_toc}

{{site.alert.secondary}}

The following example displays "Hey!" three times,
but at different font sizes and in different colors.
`Row` specifies the `crossAxisAlignment`
Expand Down Expand Up @@ -2528,6 +2531,7 @@ Future<void> main() async {
],
);
```

{{site.alert.end}}

```run-dartpad:theme-dark:mode-flutter:width-100%:height-400px:split-60
Expand Down
17 changes: 10 additions & 7 deletions src/community/tutorials/memory-leak-monitoring-on-flutter.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,12 @@ Flutter 中的 Dart 是不支持反射的(为了优化打包体积,关闭了

{{site.alert.note}}

简单说明下 Library 是什么东西,
Dart 中的分包管理是根据 Library 来的,
同一个 Library 内的类名不能重复,
一般情况下一个 `.dart` 文件就是一个 Library,
当然也有例外,比如:part of 和 export。
简单说明下 Library 是什么东西,
Dart 中的分包管理是根据 Library 来的,
同一个 Library 内的类名不能重复,
一般情况下一个 `.dart` 文件就是一个 Library,
当然也有例外,比如:part of 和 export。

{{site.alert.end}}

`vm_service` 有个 [invoke(isolateId, targetId, selector, argumentIds)](https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#invoke) API,
Expand Down Expand Up @@ -344,7 +345,8 @@ Dev Tools 是调用了 `vm_service` 的

{{site.alert.note}}

通过 dev_tools dump 出来的对象来看,的确泄漏了!
通过 dev_tools dump 出来的对象来看,的确泄漏了!

{{site.alert.end}}

也就是 1.9.1 Framework 里面存在着泄漏,
Expand Down Expand Up @@ -441,7 +443,8 @@ Flutter 的 widget tree 的层次是非常深的。

{{site.alert.note}}

好消息是以上泄漏都在 1.12 版本之后修复了。
好消息是以上泄漏都在 1.12 版本之后修复了。

{{site.alert.end}}

修复完上述两个泄漏之后,
Expand Down
Loading

0 comments on commit 2c84217

Please sign in to comment.