Skip to content

Commit

Permalink
Adds uninstall page (flutter#10038)
Browse files Browse the repository at this point in the history
Add uninstall page. Fixes flutter#5695
  • Loading branch information
atsansone committed Apr 5, 2024
1 parent 800af52 commit 09b45d7
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 12 deletions.
10 changes: 10 additions & 0 deletions src/_includes/docs/install/next-steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Manage your Flutter SDK

To learn more about managing your Flutter SDK install,
check out the following resources.

* [Upgrade Flutter][upgrade]
* [Uninstall Flutter][uninstall]

[upgrade]: /release/upgrade
[uninstall]: /get-started/uninstall?tab={{os | downcase}}
2 changes: 1 addition & 1 deletion src/_includes/docs/install/reqs/macos/base.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% assign target = include.target %}
{% assign os = include.os %}

## System requirements
## Verify system requirements

To install and run Flutter,
your {{os}} environment must meet these requirements:
Expand Down
Empty file.
33 changes: 33 additions & 0 deletions src/_includes/docs/install/reqs/windows/unset-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% assign terminal=include.terminal %}

### Remove Flutter from your Windows PATH variable
{:.no_toc}

To remove Flutter commands from {{terminal}},
remove Flutter to the `PATH` environment variable.

1. Press <kbd>Windows</kbd> + <kbd>S</kbd>.

1. Type `environment`.

1. When **Edit the system environment variables** displays
as the **Best match**, click **Open** under
**Edit the system environment variables**.

1. Click **About**.

1. Click **Advanced System Settings**.

1. Click **Environment Variables...**

The **Environment Variables** dialog displays.

1. Under **User variables for \<user\>** check for the **Path** entry.

{:type="a"}
1. If the entry exists, click **Delete**.

1. Click **OK**.

1. To enable these changes,
close and reopen any existing command prompts and {{terminal}} instances.
13 changes: 7 additions & 6 deletions src/_sass/components/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pre {

@media screen {
.str { color: $flutter-color-blue-600 } /* string content */
.kwd { color: $flutter-color-teal-darker } /* a keyword */
.kwd { color: $flutter-color-teal } /* a keyword */
.com { color: #6e6e70 } /* a comment */
/* punctuation, lisp open bracket, lisp close bracket */
.pun, .opn, .clo { color: #222 }
Expand Down Expand Up @@ -67,13 +67,14 @@ pre.console-output {
// `terminal` is like `console` with prompts and output colored differently
.language-terminal .highlight {
@include console-base;
.gp { color: $grey-500; } /* Generic.Prompt */
.gp { color: $flutter-color-yellow; } /* Generic.Prompt */
.go { color: $generic-output-color; } /* Generic.Output */
.nb, .nt { color: #99BB00; } /* Name.Builtin, Name.Tag */
.k, .kc, .kd, .kn, .kp, .kr, .kt { color: $flutter-color-blue-on-dark; } /* Keyword.* */
.nb, .nt { color: $flutter-color-blue-on-dark; } /* Name.Builtin, Name.Tag */
.nv { color: #03bbbb; }
.o { color: $grey-500; font-weight: bold; } /* Operator */
.s, .s1, .s2 { color: #00CCEE; } /* String, .Single, .Double quotes */
.sb { color: #f56b78; } /* String.Backtick */
.o { color: $flutter-color-grey-500; font-weight: bold; } /* Operator */
.s, .s1, .s2 { color: $flutter-color-blue-on-dark; } /* String, .Single, .Double quotes */
.sb { color: $flutter-color-fuchsia; } /* String.Backtick */
}

// Match code-prettify classes to the extent possible.
Expand Down
1 change: 1 addition & 0 deletions src/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ document.addEventListener("DOMContentLoaded", function(_) {
setupTabs($('#china-os-tabs'), 'dev.flutter.china-os');
setupTabs($('#china-os-dl-tabs'), 'dev.flutter.china-os-dl');
setupTabs($('#china-os-pub-tabs'), 'dev.flutter.china-os-pub');
setupTabs($('#base-os-tabs'), 'dev.flutter.os');

prettyPrint();
});
Expand Down
2 changes: 2 additions & 0 deletions src/get-started/install/macos/desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ next:
{% include docs/install/compiler/xcode.md target='desktop' os='macOS' -%}

{% include docs/install/flutter-doctor.md target='desktop' os='macOS' platform='desktop' compiler='Xcode' -%}

{% include docs/install/next-steps.md os='macOS' -%}
2 changes: 2 additions & 0 deletions src/get-started/install/macos/mobile-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ next:
{% include docs/install/compiler/android.md target='mobile-android' os='macOS' -%}

{% include docs/install/flutter-doctor.md target='mobile-android' os='macOS' compiler='Android Studio' -%}

{% include docs/install/next-steps.md os='macOS' -%}
2 changes: 2 additions & 0 deletions src/get-started/install/macos/mobile-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ next:
{% include docs/install/compiler/xcode.md target='mobile-ios' os='macOS' -%}

{% include docs/install/flutter-doctor.md target='mobile-ios' os='macOS' compiler='Xcode' -%}

{% include docs/install/next-steps.md os='macOS' -%}
2 changes: 2 additions & 0 deletions src/get-started/install/macos/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ next:
{% include docs/install/flutter-sdk.md target='web' os='macOS' terminal='Terminal' -%}

{% include docs/install/flutter-doctor.md target='web' os='macOS' -%}

{% include docs/install/next-steps.md os='macOS' -%}
2 changes: 2 additions & 0 deletions src/get-started/install/windows/desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ next:
{% include docs/install/flutter-sdk.md target='desktop' os='Windows' terminal='PowerShell' -%}

{% include docs/install/flutter-doctor.md target='desktop' os='Windows' platform='desktop' compiler='Visual Studio' -%}

{% include docs/install/next-steps.md os='Windows' -%}
2 changes: 2 additions & 0 deletions src/get-started/install/windows/mobile.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ next:
{% include docs/install/compiler/android.md target='mobile' os='Windows' -%}

{% include docs/install/flutter-doctor.md target='mobile' os='Windows' compiler='Android Studio' -%}

{% include docs/install/next-steps.md os='Windows' -%}
2 changes: 2 additions & 0 deletions src/get-started/install/windows/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ next:
{% include docs/install/flutter-sdk.md target='web' os='Windows' terminal='PowerShell' -%}

{% include docs/install/flutter-doctor.md target='web' os='Windows' -%}

{% include docs/install/next-steps.md os='Windows' -%}
164 changes: 164 additions & 0 deletions src/get-started/uninstall/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
---
title: Uninstall Flutter
description: How to remove the Flutter SDK.
toc: true
os-list: [Windows, macOS, Linux, ChromeOS]
---

To remove all of Flutter from your {{os}} development machine,
delete the directories that store Flutter and its configuration files.

## Uninstall the Flutter SDK

Select your development platform from the following tabs.

{% comment %} Nav tabs {% endcomment -%}
<ul class="nav nav-tabs" id="base-os-tabs" role="tablist">
{% for os in page.os-list %}
{% assign id = os | downcase -%}
<li class="nav-item">
<a class="nav-link {%- if id == 'windows' %} active {% endif %}" id="{{id}}-tab" href="#{{id}}" role="tab" aria-controls="{{id}} {{id}}-dl {{id}}-pub" aria-selected="true">{{os}}</a>
</li>
{% endfor -%}
</ul>

{% comment %} Tab panes {% endcomment -%}
<div class="tab-content">
{% for os in page.os-list %}
{% assign id = os | downcase -%}

{% case os %}
{% when 'Windows' -%}
{% assign dirinstall='C:\dev\' %}
{% assign localappdata='%LOCALAPPDATA%\' %}
{% assign appdata='%APPDATA%\' %}
{% assign unzip='Extract-Archive' %}
{% assign path='C:\dev\' %}
{% assign prompt-start='C:\>' %}
{% assign prompt=path | append: '>' %}
{% assign terminal='PowerShell' %}
{% assign rm = 'Remove-Item -Recurse -Force -Path ' %}
{% capture rm-sdk %}Remove-Item -Recurse -Force -Path '{{dirinstall}}flutter'{% endcapture %}
{% capture dart-files %}
{{localappdata}}.dartServer
{{appdata}}.dart
{{appdata}}.dart-tool
{% endcapture %}
{% capture rm-dart-files %}
{{prompt}} {{rm}} {{localappdata}}.dartServer,{{appdata}}.dart,{{appdata}}.dart-tool
{% endcapture %}
{% capture flutter-files %}{{appdata}}.flutter-devtools{% endcapture %}
{% capture rm-flutter-files %}
{{prompt}} {{rm}} {{flutter-files}}
{% endcapture %}
{% capture rm-pub-dir %}
{{prompt}} {{rm}} {{localappdata}}Pub\Cache
{% endcapture %}
{% else -%}
{% assign dirinstall='~/development' %}
{% assign dirconfig='~/' %}
{% assign path='~/development/' %}
{% assign prompt='$' %}
{% assign prompt-start=prompt %}
{% assign rm = 'rm -rf ' %}
{% assign rm-sdk = 'rm -rf ' | append: dirinstall | append: '/flutter' %}
{% capture dart-files %}
{{dirconfig}}.dart
{{dirconfig}}.dart-tool
{{dirconfig}}.dartServer
{% endcapture %}
{% capture rm-dart-files %}
{{prompt}} {{rm}} {{dirconfig}}.dart*
{% endcapture %}
{% capture flutter-files %}
{{dirconfig}}.flutter
{{dirconfig}}.flutter-devtools
{{dirconfig}}.flutter_settings
{% endcapture %}
{% capture rm-flutter-files %}
{{prompt}} {{rm}} {{dirconfig}}.flutter*
{% endcapture %}
{% capture rm-pub-dir %}
{{prompt}} {{rm}} {{dirconfig}}.pub-cache
{% endcapture %}
{% endcase -%}

<div class="tab-pane {%- if id == 'windows' %} active {% endif %}" id="{{id}}" role="tabpanel" aria-labelledby="{{id}}-tab" markdown="1">

This guide presumes that you installed Flutter in `{{path}}` on {{os}}.

To uninstall the SDK, remove the `flutter` directory.

```terminal
{{prompt}} {{rm-sdk}}
```

## Remove configuration and package directories
{:.no_toc}

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
{:.no_toc}

If you don't want to preserve your Flutter configuration,
remove the following directories from your home directory.

```nocode
{{ flutter-files | strip }}
```

To remove these directories, run the following command.

```terminal
{{rm-flutter-files | strip}}
```

### Remove Dart configuration files
{:.no_toc}

If you don't want to preserve your Dart configuration,
remove the following directories from your home directory.

```nocode
{{ dart-files | strip}}
```

To remove these directories, run the following command.

```terminal
{{rm-dart-files | strip}}
```

### Remove pub package files
{:.no_toc}

{{site.alert.important}}
If you want to remove Flutter but not Dart,
don't complete this section.
{{site.alert.end}}

If you don't want to preserve your pub packages,
remove the `.pub-cache` directory from your home directory.

```terminal
{{rm-pub-dir | strip}}
```

{% if os=='Windows' -%}
{% include docs/install/reqs/{{os | downcase}}/unset-path.md terminal=terminal -%}
{% endif %}

</div>

{% endfor -%}
</div>
{% comment %} End: Tab panes. {% endcomment -%}

## Reinstall Flutter

You can [reinstall Flutter](/get-started/install) at any time.
If you removed the configuration directories,
reinstalling Flutter restores them to default settings.
10 changes: 5 additions & 5 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ widgets in [What is State?][]
</div>
</div>

[first-app]: {{site.youtube-site}}/watch?v=xWV71C2kp38
[What is State?]: {{site.youtube-site}}/watch?v=QlwiL_yLh6E
[first-app]: {{yt-watch}}?v=xWV71C2kp38
[What is State?]: {{yt-watch}}?v=QlwiL_yLh6E

{:.text-center}
<b>Only have 60 seconds? Learn how to build and deploy a Flutter App!</b>
**Only have 60 seconds? Learn how to build and deploy a Flutter App!**

<div style="display: flex; align-items: center; justify-content: center; flex-direction: column;">
<iframe style="max-width: 100%" width="560" height="315" src="{{yt-embed}}/ZnufaryH43s" title="Learn how to build and deploy a Flutter app in 60 seconds" {{yt-set}}></iframe>
Expand All @@ -121,8 +121,8 @@ using helper methods][standalone-widgets] or
</div>
</div>

[standalone-widgets]: {{site.youtube-site}}/watch?v=IOyq-eTRhvo
[buildcontext]: {{site.youtube-site}}/watch?v=rIaaH87z1-g
[standalone-widgets]: {{yt-watch}}?v=IOyq-eTRhvo
[buildcontext]: {{yt-watch}}?v=rIaaH87z1-g

To learn about all of the Flutter video series,
see our [videos][] page.
Expand Down

0 comments on commit 09b45d7

Please sign in to comment.