Uninstall Flutter
To remove all of Flutter from your development machine, delete the directories that store Flutter and its configuration files.
Uninstall the Flutter SDK
#Select your development platform from the following tabs.
This guide presumes that you installed Flutter in C:\user{username}dev
on Windows.
To uninstall the SDK, remove the flutter
directory.
C:\> Remove-Item -Recurse -Force -Path 'C:\user{username}dev'flutter'
Remove configuration and package directories
#Flutter and Dart install additional directories in your home directory. These contain configuration files and package downloads. Each of the following procedures are optional.
Remove Flutter configuration files
#If you don't want to preserve your Flutter configuration, remove the following directories from your home directory.
%APPDATA%'.flutter-devtools
To remove these directories, run the following command.
C:\> Remove-Item -Recurse -Force -Path $env:APPDATA'.flutter-devtools
Remove Dart configuration files
#If you don't want to preserve your Dart configuration, remove the following directories from your home directory.
%LOCALAPPDATA%'.dartServer
%APPDATA%'.dart
%APPDATA%'.dart-tool
To remove these directories, run the following command.
C:\> Remove-Item -Recurse -Force -Path $env:LOCALAPPDATA'.dartServer,$env:APPDATA'.dart,$env:APPDATA'.dart-tool
Remove pub package files
#If you don't want to preserve your pub packages,
remove the .pub-cache
directory from your home directory.
C:\> Remove-Item -Recurse -Force -Path $env:LOCALAPPDATA'Pub\Cache
Remove Flutter from your Windows Path variable
#To remove Flutter commands from PowerShell,
remove Flutter to the PATH
environment variable.
-
按下快捷键 Windows + Pause。
如果你的键盘上没有 Pause 键,请尝试 Windows + Fn + B。
这将会显示 系统 > 系统信息 的窗口。
-
单击 高级系统设置 > 高级 > 环境变量…
这将会显示 环境变量 的窗口。
-
Under User variables for (username) section, look for the Path entry.
-
Double-click on it.
The Edit Environment Variable dialog displays.
-
Click the %USERPROFILE%\dev\flutter\bin entry.
-
Click Delete.
-
Click OK three times.
-
-
To enable these changes, close and reopen any existing command prompts and PowerShell instances.
This guide presumes that you installed Flutter in ~/development/
on macOS.
To uninstall the SDK, remove the flutter
directory.
rm -rf ~/development/flutter
Remove configuration and package directories
#Flutter and Dart install additional directories in your home directory. These contain configuration files and package downloads. Each of the following procedures are optional.
Remove Flutter configuration files
#If you don't want to preserve your Flutter configuration, remove the following directories from your home directory.
~/.flutter
~/.flutter-devtools
~/.flutter_settings
To remove these directories, run the following command.
rm -rf ~/.flutter*
Remove Dart configuration files
#If you don't want to preserve your Dart configuration, remove the following directories from your home directory.
~/.dart
~/.dart-tool
~/.dartServer
To remove these directories, run the following command.
rm -rf ~/.dart*
Remove pub package files
#If you don't want to preserve your pub packages,
remove the .pub-cache
directory from your home directory.
rm -rf ~/.pub-cache
Remove Flutter from your macOS PATH
#To remove Flutter commands from PowerShell,
remove Flutter to the PATH
environment variable.
This guide presumes your Mac runs the latest default shell, zsh
.
Zsh uses the .zshenv
file for environment variables.
-
Launch your preferred text editor.
-
Open the Zsh environmental variable file
~/.zshenv
-
Remove the following line at the end of your
~/.zshenv
file.bashexport PATH=$HOME/development/flutter/bin:$PATH
-
Save your
~/.zshenv
file. -
To apply this change, restart all open terminal sessions.
If you use another shell, check out this tutorial on removing a directory from your PATH.
This guide presumes that you installed Flutter in ~/development/
on Linux.
To uninstall the SDK, remove the flutter
directory.
rm -rf ~/development/flutter
Remove configuration and package directories
#Flutter and Dart install additional directories in your home directory. These contain configuration files and package downloads. Each of the following procedures are optional.
Remove Flutter configuration files
#If you don't want to preserve your Flutter configuration, remove the following directories from your home directory.
~/.flutter
~/.flutter-devtools
~/.flutter_settings
To remove these directories, run the following command.
rm -rf ~/.flutter*
Remove Dart configuration files
#If you don't want to preserve your Dart configuration, remove the following directories from your home directory.
~/.dart
~/.dart-tool
~/.dartServer
To remove these directories, run the following command.
rm -rf ~/.dart*
Remove pub package files
#If you don't want to preserve your pub packages,
remove the .pub-cache
directory from your home directory.
rm -rf ~/.pub-cache
This guide presumes that you installed Flutter in ~/development/
on ChromeOS.
To uninstall the SDK, remove the flutter
directory.
rm -rf ~/development/flutter
Remove configuration and package directories
#Flutter and Dart install additional directories in your home directory. These contain configuration files and package downloads. Each of the following procedures are optional.
Remove Flutter configuration files
#If you don't want to preserve your Flutter configuration, remove the following directories from your home directory.
~/.flutter
~/.flutter-devtools
~/.flutter_settings
To remove these directories, run the following command.
rm -rf ~/.flutter*
Remove Dart configuration files
#If you don't want to preserve your Dart configuration, remove the following directories from your home directory.
~/.dart
~/.dart-tool
~/.dartServer
To remove these directories, run the following command.
rm -rf ~/.dart*
Remove pub package files
#If you don't want to preserve your pub packages,
remove the .pub-cache
directory from your home directory.
rm -rf ~/.pub-cache
Reinstall Flutter
#除非另有说明,本文档之所提及适用于 Flutter 的最新稳定版本,本页面最后更新时间: 2024-06-26。 查看文档源码 或者 为本页面内容提出建议。