1

I need to switch from and to stable and master channels frequently, to use some new features or to be able to run some projects (like flutter/gallery).

and every time I run the command flutter channel master/stable followed by flutter upgrade, it seems that a new Dart SDK is being downloaded with a lot of other suff (see the output bellow), so, the switching doesn't come at ease, and I have to wait, even the time between channels is seconds!

> flutter channel stable
Switching to flutter channel 'stable'...
git: Your branch is up to date with 'origin/stable'.
git: Switched to branch 'stable'
Successfully switched to flutter channel 'stable'.
To ensure that you're on the latest build from this channel, run 'flutter upgrade'
PS D:\DevLib\Flutter\flutter_course> flutter doctor        
Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 6bc433c6b6b5b98dcf4cc11aff31cdee90849f32...
Unzipping Dart SDK...
Building flutter tool...
Running pub upgrade...

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║                 Welcome to Flutter! - https://flutter.dev                  ║
  ║                                                                            ║
  ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
  ║ statistics and basic crash reports. This data is used to help improve      ║
  ║ Flutter tools over time.                                                   ║
  ║                                                                            ║
  ║ Flutter tool analytics are not sent on the very first run. To disable      ║
  ║ reporting, type 'flutter config --no-analytics'. To display the current    ║
  ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out    ║
  ║ event will be sent, and then no further information will be sent by the    ║
  ║ Flutter tool.                                                              ║
  ║                                                                            ║
  ║ By downloading the Flutter SDK, you agree to the Google Terms of Service.  ║
  ║ Note: The Google Privacy Policy describes how data is handled in this      ║
  ║ service.                                                                   ║
  ║                                                                            ║
  ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and  ║
  ║ crash reports to Google.                                                   ║
  ║                                                                            ║
  ║ Read about data we send with crash reports:                                ║
  ║ https://flutter.dev/docs/reference/crash-reporting                         ║
  ║                                                                            ║
  ║ See Google's privacy policy:                                               ║
  ║ https://policies.google.com/privacy                                        ║
  ╚════════════════════════════════════════════════════════════════════════════╝


Downloading package sky_engine...                                   1.6s
Downloading flutter_patched_sdk tools...                            6.4s
Downloading flutter_patched_sdk_product tools...                    6.4s
Downloading windows-x64 tools...                                   14.9s
Downloading windows-x64/font-subset tools...                        2.3s
Downloading android-arm-release/windows-x64 tools...                1.5s
Downloading android-arm64-profile/windows-x64 tools...              1.9s
Downloading android-arm64-release/windows-x64 tools...              1.5s
Downloading android-x64-profile/windows-x64 tools...                1.9s
Downloading android-x64-release/windows-x64 tools...                1.7s
Doctor summary (to see all details, run flutter doctor -v):
mshwf
  • 7,009
  • 12
  • 59
  • 133
  • I'm not getting the question... if there's one. There's a lot of things involved between channels and those needs to compile for different platforms, that's why. – Mariano Zorrilla May 21 '20 at 23:43
  • Does it seems intuitive to you that switching stable->master->stable (in a fraction of second) should download the Dart SDK and all the binaries (look at the last lines with time at the end of it) over and over again? – mshwf May 22 '20 at 00:05
  • I don't really think that's intuitive... but is not a topic for StackOverFlow. Maybe Reddit if a better take for something like this or even a report over Github and get feedback from the Google team. – Mariano Zorrilla May 22 '20 at 01:28
  • Simple solution for MacOS (Linux) https://stackoverflow.com/a/66224133/12118935 – ArRo Feb 16 '21 at 12:26

1 Answers1

0

Yeah, there is basically no caching on channel switch afaik.

I suggest you take a look at this article, as well as this plugin.

MickaelHrndz
  • 3,604
  • 1
  • 13
  • 23