#2 - How to install the Dart SDK on Windows, Linux and MacOS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what is going on everyone i'm wicked and welcome back to my dark from novice to expert complete course today i will show you how to get and install the dart sdk on your personal computer whether it's a windows linux or mac os machine i'll get you covered in this complete video so without further ado let's get right into it first of all let's talk a little bit about the dart sdk what exactly is the dart sdk and more precisely what is an sdk well sdk stands for software development kit and as you may observe from its name it is mainly a collection of software development tools tools that facilitate the creation of different applications some of the tools include compilers debuggers libraries and perhaps the software framework aiding towards the development process of creating an app therefore in the case of dart the dart sdk comes packed with the dart analyzer and the compilers we discussed in the previous video and perhaps many other tools that we'll cover in future videos like libraries and debuggers however before we get into the installation part you need to know a couple of important things first of all installing the dart sdk will only allow you to develop dart command line server and non-flutter web apps that means you can't build flutter apps with only the dart sdk installed on your machine in order to do that you'll also need the flutter sdk second of all since slaughter became such a popular framework as of flutter version 1.21 the flutter sdk includes the full dart sdk so if you have flutter greater than 1.21 installed on your pc chances are that the dart sdk is already installed on your machine however since this course is 100 related to dart and not splatter and based on the fact that a priority to learning flutter you should definitely learn dart i'll assume that most of my viewers watching these tutorials don't have either flutter sdk nor dart sdk installed on their personal computers another thing you should take into consideration is that you don't need the dart sdk in order to go throughout this tutorial you can simply use the dart pad web editor by accessing dartpad.dev here you can type and run your dart code without any problem however i don't recommend this approach at all i only use dartpad to test some short containers of code and check if it works as i think it should that's all for example here i wanted to check if the clamp method gives me the output i was expecting what you need to realize is that getting to know and understand the dart sdk is a critical step in understanding dart and the dart pad doesn't really offer that in-depth experience therefore i'll continue by showing you how to install the dart sdk standalone on your machine so by the time i'm making this tutorial the dart sdk is supported on windows linux and mac os regarding the windows platform only windows 10 is supported both intel 32 and 64-bit architectures regarding the linux platform every recent linux version should be supported on either of these four architectures and regarding the mac os platform the latest three major versions are supported as for this date the mac os bixer catalina and mojave are all supported on their 64-bit architecture the support for the new amazing apple m1 silicon chip built on rm64 architecture is currently in progress it is expected to be supported in the june beta release of the sdk and since we got the beta version of the sdk into discussion you need to know that the dart sdk has three release channels the stable channel the beta channel and the dev channel the stable channel contains stable releases of the dart sdk suitable for production use and it is updated roughly every three months the stable channel releases have x.y.z version strings where x is the major version y is the minor version and z is the patch version the beta channel contains preview releases of the dart sdk that means what is usually introduced in beta will eventually get introduced into the stable channel later on of course if the new features run stable enough the beta channel is recommended only to preview new dart features or to test compatibility of your already existing apps with future releases and it is usually updated every month the dev channel contains prereleases that may be broken unsupported and may contain unwanted breaking changes they also contain the most recent code changes introduced in dart and are usually updated twice a week the beta and dev channel releases have x.y.z hyphen a dot b and the beta dev version strings for the x.y.z it follows the stable version scheme and the a and b after the hyphen are the pre-release and pre-release patch versions while the keyword beat our dev as you may think stands for the channel they were released into okay so since we want our workflow to be steady and stable we'll go on and install the latest table release of the dart sdk which at this time and date is version 2.12.4 now there are different methods on how you can install the dart sdk on windows linux and mac os however we'll go with the fastest and most scalable method over time and that is by installing it with a package manager choosing this path allows us to have a more organized structure of every package we'll install in the future while also being able to simply update them fast from the command line i'm going to start by installing the dart sdk on windows platform and in order to do that we'll use the chocolaty package manager if you have already installed chocolately feel free to skip to the dart sdk installation part so in order to install chocolaty you need to browse to chocolatey.org install then you'll have to open a windows powershell as administrator you'll need to follow these instructions in order to ensure that the get execution policy is not restricted on your machine then all you have to do is to copy and paste this line of code into your powershell and hit enter chocolaty will be installed in a few moments if you close and reopen the powershell as admin again you should be able to see the chocolatey version when you type the chuckle command and as you can see it worked perfectly for me now we're done with installing the package manager now it's time for us to search for the dart sdk chocolaty package in order to do that we'll browse the checklity community and search for dart sdk as you can see we can also filter the results by stable and pre-released versions in our case we'll stick to the latest stable version of dart as we said before all we need to do now is to copy this line paste it in the powershell and hit enter the installation should take about one or two minutes as you can see the terminal prompted us with the location where it installed the dart sdk what's also great about chocolaty is that it will automatically add the dart sdk to the environment path variables inside windows so that you won't need to do that manually having that said we can restart a powershell one more time and type in the dart command we'll be greeted with the amazing dart command line interface meaning that dart sdk has been successfully installed on our windows machine on linux installing dart sdk is perhaps the easiest out of all three platforms because of the fact that it comes by default pre-installed with the advanced package tool or aft i'm using pop os as it is my favorite linux distribution but you can use whatever distro you may like the most so all you have to do now is to browse to dart dot dev get minus dart copy these lines of code one by one in the terminal in order to configure the download files and then copy paste and run these two last commands that will install the dart sdk it is also really convenient that the environment pad variables are again automatically configured with the path to the dart sdk folder as you can see the installer finished and if we type and run the dart command we'll also be greeted by the dart command line interface meaning that the dart sdk has been successfully installed on our linux machine hooray on mac os installing dart sdk is again done by a really popular package manager the home brew if you have already installed homebrew feel free to skip to the dart sdk installation part so in order to install the homebrew package manager all you need to do is to go to brew.sh copy this entire line of code open a terminal paste it and run it the installation of hombre will take a while so be patient after the installation is finished you can tap and run the brute brew-version command to see if it was successfully installed on your mac now in order to install the dart sdk we'll again need to go to dart.dev get minus dart copy these two lines of code and run them one by one after the installation finished you should be able to type the dart command into the terminal and be greeted by the dart command line interface sign that the dart sdk has been successfully installed on your mac os and voila we have already seen the dart command line interface on all three platforms we installed dart on but what exactly is it and how we can use it to our benefit running the dart command from the terminal means that the path to our dart sdk which is just a folder on our pc containing all the goodies from inside dart is set as an environment variable this environment variable is accessible from the terminal no matter what path it's open inside it notice that if i change the path to a different one the dart command will still work what actually happens when you run this command is simply the terminal calling the dart executable from inside that sdk folder as the path to this file is exposed globally by the environment variable that's all the magic it does therefore the dart cli incorporates all the commands the dart sdk offers in order to facilitate the coding process for every developer take a moment and analyze every line displayed by the cli in order to briefly understand it this is an important step in learning anything step back from the keyboard and glass over the subject you're interested in now as you may think some of the commands here look really familiar to those we discussed in the previous video the analyze command for example will put a static analyzer to the test in the current folder in order to scan for compile time errors inside the compile commands there are different types of compilers like git and aot you can compile your dart files with we discussed them in a previous video what i can tell you is that we'll explore every command and feature of the dart cli more in depth in the next video when we'll finally create our first dart project until then i advise you to take a look at every command by adding the help suffix and make an idea about what they're all about that was it for today if you like this tutorial don't forget to hit the like button subscribe to my channel and share the video with your colleagues and friends in pursuit of top tier development until next time take care wicked is out bye bye
Info
Channel: Flutterly
Views: 3,583
Rating: undefined out of 5
Keywords: dart, dart language, dart sdk, dart 2021, dart from novice to expert, dart tutorial, dart course, dart windows, dart linux, dart macos, dart cli
Id: WIO5iAeNaOU
Channel Id: undefined
Length: 11min 23sec (683 seconds)
Published: Fri Apr 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.