我在 Flutter SDK 中使用哪个通道?

Which channel do I use in Flutter SDK?

预览版 1 在“ Announcing Flutter Release Preview 1 – Flutter – Medium"

在文档中下载最新的 Flutter SDK beta 版本。 Get Started: Install on macOS - Flutter

最新的测试版是 0.5.1。 2个月前更新...

$ flutter upgrade

Flutter 0.5.1 • channel beta • https://github.com/flutter/flutter.git
Framework • revision c7ea3ca377 (9 weeks ago) • 2018-05-29 21:07:33 +0200
Engine • revision 1ed25ca7b7
Tools • Dart 2.0.0-dev.58.0.flutter-f981f09760

最新的主发布版本是 0.5.8-pre.163。

$ flutter channel master
$ flutter upgrade

Flutter 0.5.8-pre.163 • channel master • https://github.com/flutter/flutter.git
Framework • revision 29410abbe7 (2 days ago) • 2018-07-27 22:10:39 -0700
Engine • revision 72a38a6b13
Tools • Dart 2.0.0-dev.69.3.flutter-937ee2e8ca

我在Flutter SDK中使用哪个渠道?

来自Flutter wiki

Flutter has the following channels, in increasing order of stability:

master

The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things.

dev

The latest fully-tested build. Usually functional, but see Bad Builds for a list of known "bad" dev builds. We continually try to roll master to dev. Doing so involves running many more tests than those that we run during master development, which is why this is not actually the same to master.

beta

Every month, we pick the "best" dev build of the previous month or so, and promote it to beta. These builds have been tested with our codelabs.

stable

When we believe we have a particularly good build, we promote it to the stable channel. We intend to do this more or less every quarter, but this may vary. We recommend that you use this channel for all production app releases. We may ship hotfixes to the stable channel for high-priority bugs, although our intent is to do this rarely.

因此,请使用您觉得舒服的渠道,满足您的需求 and/or 有您需要的任何修复程序。从 stable 开始,然后从那里开始。

现在你可以使用稳定版Branch了(Flutter version 1.0.0)。

每当您遇到来自小部件和应用程序的奇怪行为(如呈现故障或获得白色背景)时,您必须将您的频道更改为另一个频道并使用该频道重建应用程序。 在终端中键入此命令:

1- 当前频道:

flutter channel

2- 更改频道:

flutter channel CHANNEL_NAME

例如将频道更改为主频道:

flutter channel master

根据Flutter build release channels

稳定版本 推荐用于所有生产应用程序版本。

如果您想将 flutter 用于生产应用程序,那么许多开发人员甚至 google 都建议使用 stable 。如果您正在使用 flutter 提供的新功能和所有功能,我会推荐 master,但不推荐仅用于爱好项目的生产,并提高您的 flutter 技能和测试 flutter 提供的新事物。在 flutter stable 中不可用。

现在知道您当前使用的是哪个分支。 打开终端并输入以下命令。

flutter channel

它会显示前面有start的分支。那是你当前的分支 要更改分支,您只需使用此命令即可。

flutter channel ChannelName 

分别使用频道名称并按回车键,然后运行执行以下命令

flutter upgrade

它将从 flutter GitHub 下载所有需要的文件,你就可以开始了。

所有可能的 flutter 通道如下。

master

The current tip-of-tree, absolute latest cutting edge build. Usually functional, though sometimes we accidentally break things.

dev

The latest fully-tested build. Usually functional, but see Bad Builds for a list of known "bad" dev builds. We continually try to roll master to dev. Doing so involves running many more tests than those that we run during master development, which is why this is not actually the same to master.

beta

Every month, we pick the "best" dev build of the previous month or so, and promote it to beta. These builds have been tested with our codelabs.

stable

When we believe we have a particularly good build, we promote it to the stable channel. We intend to do this more or less every quarter, but this may vary. We recommend that you use this channel for all production app releases. We may ship hotfixes to the stable channel for high-priority bugs, although our intent is to do this rarely.

flutter --version

使用此命令,您可以获得有关您的开发工具及其版本的更多详细信息。

  • Flutter 版本
  • 频道
  • git远程
  • git头
  • 引擎
  • Dart 版本

就我而言:

Flutter 1.17.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision 8af6b2f038 (7 days ago) • 2020-06-30 12:53:55 -0700 Engine • revision ee76268252 Tools • Dart 2.8.4

flutter 团队推荐使用 stable 分支。

也就是说,测试版分支应该没问题。我们对 stable 所做的测试没有比对 beta 进行的额外级别的测试,除了 beta 分支上的延长稳定期。因此,如果您想要使用 beta 而不是 stable 的内容,请随时考虑使用 beta.

使用dev安全性稍差;如果您使用 dev 版本,那么我们建议您查看 Bad Builds 页面以查看是否为该分支报告了已知的 ship-blocking 错误。然而,选择一个 dev 版本,使用该版本进行大量测试,然后继续使用该版本是合理的。这就是我们在选择 dev 构建以放入 beta 分支时实际做的事情:我们实际对 dev 构建的 beta 构建所做的唯一额外测试是检查基本的事情,比如“做我们的Codelabs 仍然适用于此版本”;除此之外,我们只监控错误报告。我们的大部分测试都是作为提交前测试和测试 运行 作为发布 dev 构建的一部分完成的,因此当我们发布 dev 构建时,我们有相对较高的信心没有严重的问题。

更新(Flutter 2.8

Flutter 共有三个通道:

  • 稳定

The stable channel represents the highest-quality builds we have. They’re released quarterly (roughly), and are hotfixed for critical issues in between. This is the “slow” channel: safe, mature, long-term servicing.

  • 测试版

The beta channel provides a fast-moving alternative to stable for those who are comfortable with a faster cadence. Currently released monthly, stabilized prior to release. This is the “fast” channel. If we find that the dev channel was serving needs that the beta channel cannot currently serve, we may change how we think of the beta channel to address those needs as well (for example, accelerating the release cadence for beta or reducing the level of testing and hot fixing that we perform on beta).

  • 高手

The master channel is our active development channel. We provide no support on this channel, but we run a comprehensive suite of unit tests against it. This is the right channel for contributors or advanced users who are comfortable with unstable builds. On this channel, we run fast and break things (and then fix them pretty fast, too)

要查看您正在使用的频道,运行

flutter channel

要更改频道(例如 beta),运行:

flutter channel beta
flutter upgrade