How to properly install flutter and dart?

538 views
Skip to first unread message

K leo

unread,
Jul 13, 2020, 3:58:10 AM7/13/20
to Flutter Development (flutter-dev)
I am very new, sorry first for a stupid question.

According to flutter documentation (https://flutter.dev/docs/get-started/install/linux), I downloaded and unpacked it in ~/Software/, and set up the PATH according to the doc.  According to the doc, dart is included in the package.

First strange thing is that dart is not in ~/Software/flutter/bin.  With 'find' under flutter directory, dart in buried under a cache directory under bin.  Through some googling, I read that I need to first remove the cache directory.  After that, with perhaps 'flutter config' (I can't remember exactly the command now), I see a new cache directory is created under bin and fortunately, dart is under bin now.

But, pub is still not under bin, it's in ~/Software/flutter/bin/cache/dart-sdk/bin/. 

My question is if my installation process correct?  If so, should I include ~/Software/flutter/bin/cache/dart-sdk/bin/ in PATH.  As 'cache' indicates something temporary, I would think I shouldn't rely on it, right?


Souvik Dutta

unread,
Jul 13, 2020, 11:51:52 AM7/13/20
to K leo, Flutter Development (flutter-dev)
My guess is that dart SDK is under cache so that a smooth update to a newer SDK version can be guaranteed. This is only a guess and I could be wrong. 

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/15c15c12-cb70-435a-b398-39ce904e8c17o%40googlegroups.com.

james larana

unread,
Jul 13, 2020, 3:23:52 PM7/13/20
to Flutter Development (flutter-dev)
Install Flutter on Windows 10, Android Studio and Virtual Studio (VS) Code successfully, and hassle FREE!

A complete checklist of Everything you need to Install and run Flutter on Windows 10, Android Studio and Virtual Studio (VS) Code successfully, hassle FREE!

Follow these steps. Each step has the best YouTube video link below available on how to install that particular component or components. There is no need of reinventing the wheel, therefore, allow me to point you to what you need to do.

���NOTE: You must be connected to the internet to successfully install and create a new flutter project.

Step 1.
? Download and install jdk8, and set the environment variables.
This is the Java SE Development Kit (JDK) that Flutter uses, if you install any other jdk version that is not jdk8 flutter will throw unkown errors and won't emulate.
� Note: jdk8 will automatically install it's jre8 so there's no need to download jre8 as a separate file.
=> YouTube video Link to a how to do this is in description below.

1. (i) Install jdk8
How to Install Java JDK 8 on Windows 10 UPDATED ( 720 X 720 )
https://www.youtube.com/watch?v=ClcHrcNXP9g

Use the video below to set JAVA_HOME
1. (ii) Set JAVA_HOME environmen variable
[JAVA] How to Install JDK 13JRE 8 with JAVA_HOME in Windows 10 (718 x 1280)
https://www.youtube.com/watch?v=iNsCpPNABnE

Step 2.
? Download and install the latest version of Gradle and set its environment variables.
=> YouTube video Link on how to do this is in description below.

How to install Gradle 5.5 on Windows 10_ ( 720 X 720 )
https://www.youtube.com/watch?v=NM18-xCchh8

Step 3.
? Download and install the latest version of Git

Git: How to Download & Install Git on Windows 10 & Choose Install Options
https://www.youtube.com/watch?v=nbFwejIsHlY

Step 4.
? Download and install the latest Flutter SDK, and set its environment variable.
Download and install the latest Android Studio SDK.
� Note: Android Studio will automatically set its environment variable.
Inside Android Studio, you can now download an emulator (Virtual Machine) of your choice. Or, you can simply connect your Android phone. To do this, enable developer mode and allow USB Debugging.
=> YouTube video Link on how to do this is in description below.

Download and Install Flutter on Windows 10 - Configure & Flutter Setup on Android Studio Tutorial ( 720 X 720 )
https://www.youtube.com/watch?v=6VxMWJV8Mm4

Step 5.
? Download and install the latest Virtual Studio (VS) Code, and install the flutter extension.
=> YouTube video Link on how to do this is in description below.

Setup Flutter and Visual Studio Code In Windows ( 480 X 480 )
https://www.youtube.com/watch?v=5izFFbdHnWY

Step 6.
To verify that all the components that Flutter needs have been installed successfully...
Open your Windows cmd prompt (or, alternatively open the VS Code Terminal), run/type...
flutter doctor -v
(or alternatively simply run...)
flutter doctor
, and ONLY when all components are installed, successful (????) should you proceed to run your first Flutter app in the emulator or on your phsical device!
=> Details on how to do this is available inside the videos in the how to video links above. Below is how to run in VS Code.

VScode setup and first app on real device ( 720 X 706 )

���NOTE: You must be connected to the internet to successfully install and create your first flutter project.

K leo

unread,
Jul 13, 2020, 3:52:30 PM7/13/20
to Flutter Development (flutter-dev)
Thank you James for the detailed instructions, which unfortunately doesn't address my situation. 

I use Linux.

yes, I seem to have installed flutter and dart "hassle free".  If my original question is too wordy, the key issue I have after installing flutter is that the dart related programs that are included couldn't be directly accessed (not in PATH as per the documentation).

fuj...@google.com

unread,
Jul 13, 2020, 4:16:07 PM7/13/20
to Flutter Development (flutter-dev)
The short answer to your query is "yes", you can add `flutter/bin/cache/dart-sdk/bin` to your path.

Note that the flutter cli itself always relies on the absolute path to the cached dart-sdk, so it doesn't need dart to be on the path.

Also note that in the latest version of flutter (which hasn't landed on stable yet) we have added `flutter/bin/dart`, which is a bash wrapper around the vendored dart sdk that will ensure the cached version is correct. At that point, it is recommended not to have `flutter/bin/cache/dart-sdk/bin` on your path, as the cached version might be out of date with your flutter sdk if you `git checkout` a different version.

fuj...@google.com

unread,
Jul 13, 2020, 4:18:38 PM7/13/20
to Flutter Development (flutter-dev)
The short answer to your question is "yes", you can add `//flutter/bin/cache/dart-sdk/bin` to your path.

Please note that the Flutter CLI tool always refers to the dart binaries via absolute path to the cached dart sdk, so having it on your path is only if you wish to invoke them manually from the command line. The Flutter SDK doesn't require them to be on the path.

Also note that in the latest flutter (unfortunately this change hasn't landed in stable yet) we've added a bash wrapper at `//flutter/bin/dart` which will ensure that the cached version of the dart-sdk aligns with the current version of the flutter sdk. At this point, it will be recommended not to have `//flutter/bin/cache/dart-sdk/bin` on your path, and instead use the bash wrapper to ensure you don't use the wrong version of dart.

On Monday, July 13, 2020 at 12:52:30 PM UTC-7 cnbi...@gmail.com wrote:

K leo

unread,
Jul 13, 2020, 5:20:08 PM7/13/20
to Flutter Development (flutter-dev)
Thanks Christopher.

I now set flutter channel to "dev" (hoping to try out the ffi).  So based on your instructions, I shouldn't set`//flutter/bin/cache/dart-sdk/bin` on my path now, if I understand it correctly.  If I want to invoke dart related programs, what should I do?

wa...@clinicianfirst.com

unread,
Jul 13, 2020, 6:11:53 PM7/13/20
to Flutter Development (flutter-dev)
When I was first using flutter, I wanted to do some pure dart stand alone projects, thought I'd be slick, and reused the dart sdk bundled with flutter.
I ran into several issues, both inside and outside of my IDE and was advised to install the stand alone dart sdk (https://dart.dev/get-dart) as the dart sdk bundled with flutter has flutter specific modifications from the stand alone dart sdk.
There are no conflicts, even when putting the dart stand alone sdk in the system path, flutter commands know to use the bundled dart sdk.

I don't use vscode, I use intellij (android studio is a suitable standin replacement) but once I started using the stand alone dart sdk for stand alone dart projects, issues I had with dart IDE plugin vs flutter IDE plugin also magically disappeared.  Users of vscode have reported similar success.

In short, the dart sdk bundled with flutter is solely for the use of flutter and accessed as needed by flutter, which is why it is not exposed.  The dart sdk obtained from the link above is for stand alone dart development.  If you plan to engage in both activities, get both sdks

It might seem wasteful of some small amount of disk space, but your time is way more valuable.

Christopher Fujino

unread,
Jul 13, 2020, 6:23:37 PM7/13/20
to K leo, Flutter Development (flutter-dev)
I now set flutter channel to "dev" (hoping to try out the ffi).  So based on your instructions, I shouldn't set`//flutter/bin/cache/dart-sdk/bin` on my path now, if I understand it correctly.  If I want to invoke dart related programs, what should I do?

If you're on dev, you should be able to add `//flutter/bin` to your path and then you will get the `dart` wrapper that appears there. If you need to run a `pub` command, you can use the new `dart pub` sub-command. See `dart pub help` for more info.
 
Reply all
Reply to author
Forward
0 new messages