Flutter Windows Setup

Academind by Maximilian Schwarzmüller
A free video tutorial from Academind by Maximilian Schwarzmüller
Online Education
4.6 instructor rating • 27 courses • 1,518,757 students

Lecture description

Let's install Flutter on Windows so that we can build amazing apps there - in this lecture, I'll walk you through all the installation steps.

Learn more from the full course

Flutter & Dart - The Complete Guide [2021 Edition]

A Complete Guide to the Flutter SDK & Flutter Framework for building native iOS and Android apps

42:01:48 of on-demand video • Updated July 2021

  • Learn Flutter and Dart from the ground up, step-by-step
  • Build engaging native mobile apps for both Android and iOS
  • Use features like Google Maps, the device camera, authentication and much more!
  • Learn how to upload images and how to send manual and automated push notifications
  • Learn all the basics without stopping after them: Dive deeply into Flutter & Dart and become an advanced developer
English Maximilian: In this lecture, we'll install Flutter on a Windows machine and we'll set up Windows and install all the tools we need to develop Flutter apps on Windows. If you are not following along on Windows, you can therefore of course, skip this lecture and the next lecture as well, because in the next lecture, we'll set up the environment for writing code with for Flutter on Windows. Now the best way to start installing Flutter and everything we need is to go to Flutter.dev, which is the official website of the Flutter project. And there you can go to docs and then click on, get started and find instructions for different operating systems. And here we are, of course, interested in Windows. Now the official docs are a great place to also dive in and get written instructions in case you should get stuck at some point, we will go through all the important steps to gather here, but definitely also dive into this stocks here if you are facing any problems or if you may be just also wanna get some written instructions, in addition to this video, Now it all starts with the system requirements here. So you need to meet these requirements if you wanna use Flutter, there's no way around that. Especially the Git requirement might not be met yet, but Git is an extra tool which you normally use for controlling source code and saving source code snapshots, which is getting used by Flutter under the hood, and which we therefore need to install before we can install and use Flutter. You can just follow this link here to download an installer for Windows, so for Git for Windows. And I'll do that here, download this installer. And then once this download finished, we can simply walk through that installer and we'll do that together in just a second. Here we go. And basically just keep the defaults here. So I'll keep all these defaults, which will make working with Flutter easier since everything will just work if you use the defaults and you wanna keep all the defaults here on this page as well. Continue, you can keep this default here as well if you want to. Click next, click next here as well. And now very important on this screen here, where it's about adjusting your path environment we find on the Flutter page, that we should ensure that we can use Git from the Windows Command Prompt and therefore this middle option should be checked here. It's the default typically, it's recommended here and we should make sure that we use this option here. And then click next. We can leave that as well, leave all these defaults here and just click through all these options here and then click install at the end. And this will now install this git tool which we could use for managing our source code and for creating snapshots, you can explore a standalone courses and talks on that, but that's not a must do, but Flutter we'll use this tool under the hood and therefore we need to know install it. So let's wait for this installation to finish here. Once this did finish, I'm not going to read the release notes, but click finish. And now we can move on to installing Flutter. For this we can download it here. And of course the exact version you are seeing here when you are following along will very likely be a different one than I see here, but you will still learn Flutter in the correct way through out this course no worries. So here I'll just download Flutter and that's a around big download. So it can take a while until it's finished. And once this is finished, we will extract that Zip file, which is downloaded here and we can see that in step two here, we can place that Flutter folder, which we'll get by extracting that Zip file in any desired installation location on our system. And typically you wanna use some global location there are somewhere on your root drive. However, not in C program files, as you see here, and also not in any other folder that might have restricted access. For example, not the system 32 folder, but instead some root folder where your Windows user has full unrestricted read and write access. So for example, the documents folder and your user folder, as you see here, but you can use any root folder. So the download finished for me here and hence all extract that file here, that Zip file. And in there you find this Flutter folder, I'll now move that Flutter folders to some our destination on my system to be precise here, I'm in my a user folder. And in there I'm going to create a new folder. I do apologize for this being German here, but I'll just create a new folder, which I'll name development. And in that development folder, I'll create a new sub folder, which I'll name SDKs, and then in this SDKs folder, which is my root user folder and then in that development folder there, I'll direct that Flutter folder into. So this extracted Flutter folder goes into that SDKs folder in my development folder, in my user folder. And you should store your Flutter STK, this extracted Flutter folder in some global location like this, so that you can easily work with it from anywhere on your system later on, because that's what we'll need to do there. Now, since this is big, this can take a couple of seconds if you do it like this, and I'll we'll therefore be back ones this has been copied over. Now moving that folder finished for me here. And that means that now we did download and install Flutter, but Flutter is not a tool that we then opened by double clicking on it instead it is a tool which we typically invoke through the command prompt, which is installed on every Windows system and therefore what we need to do next is we need to update our path, which means that we make this Flutter command, this Flutter tool that we installed globally available inside of the command prompt, no matter where on our system, we then execute this. And this will be super important. Now for that what we have to do is we have to add it to our environment variables. For this, you can type env here into this quick-start area. And for me again, it's German, but this is added our environment variables. And here you wanna click on user variables or environment variables here. And then these are some global variables, which in the end all is the control, which commands can be invoked from inside your command prompt. And there you should have a path variable. If you don't have it, you can create it but very often you will have one already. And then you should add it to this path variable by clicking on edit. And here you can now add new entries to this environment variable. And here what you wanna do is you want to add an entry that points at this Flutter folder, which we moved into a global destination on our system. So for this here and back in the STKs folder, I'll go into that Flutter folder and they're into the bin folder. And then I click in here to grab this path to the bin folder on my system, this entire path that's what I need here. And in there, we have that Flutter and that dart command, and these are the commands which we wanna invoke from the Command-Line later and therefore we need to add the path to this tools to our path environment variable. So here, where I'm editing this path environment variable, I'll add a new entry to it and just paste in this path I selected so that it's part of this path environment variable and then we can click OK And now this was added here and we can now click OK again, close all these settings, and now you should be able to invoke the Flutter command from inside your command prompt. And that's what we'll try it right away. I'll open my default command prompt. You can find it by simply typing command into your quick start menu. Use this command prompt here and then here in this command prompt, you can type Flutter like that. And this should then work. It should show you a list of available commands in the end here which it does for me, it should not show any error. And that proves that we did successfully add it as an environment variable. Now in here, what you can do is you can run Flutter doctor, which is a little analysis command, which will analyze your system and see if it's ready to build Flutter apps. And this will therefore for first of all, download some extra software and then run this check. And right now it will probably fail because for example, we have not set up everything for Android development yet, and that's important because that will be the next step. We can use Flutter as a tool to build cross-platform applications, but we actually need to install extra tools, which will be used by Flutter under the hood to then really build for iOS or Android. And that's always important on Windows you unfortunately, can't build for iOS. That's a restriction by Apple, not by Flutter. You can't build iOS apps on Windows you can only build Android apps there. You need a Mac to build iOS apps there it is what it is, but we can build Android apps by going for the Android setup, which we also find here in the official docs. And what we need to do here in the Android set up is we need to install Android Studio, which is the official development environment by Google for building Android applications. So for that we can follow this link and open the Android studio website here, then simply download Android Studio. Accept the terms here, I guess, and then start this download, which is also big and therefore can take a couple of seconds or minutes. Now I'll be back once this download finished so that we can then walk through this installer, which we'll get there together. So here we go, download finished. I'll now start this installer that we downloaded here to install Android studio. And here we can now walk through that installation wizard, which for some reason is a bit blurry for me here, but anyways, we can walk through it and basically keep all these default settings, especially also make sure you're installing the Android virtual device here. We'll need dev for running Emulators later, which are virtual Android phones on our computer to test and review our Flutter apps. So we definitely want that click next, keep that default location if there is any way of doing that. So unless you really have to install it somewhere else, don't install it somewhere else. Instead, keep that default it will make working with Android so much easier because everything will just work and Flutter we'll find Android studio without issues and so on. So keep that default possible, click next and install. And this will now install Android Studio onto our system. So let's wait for this installation process to finish here. And once this is finished, we can also start it immediately. So keep that checkbox checked here and start Android studio like this. And by default, when you started for the first time, you should get this wizard here, this setup wizard. And we'll definitely go through that wizard here because we need certain settings and tools to be set up and we can set them up through that wizard. So here I'll choose custom so that I can customize everything. And the first thing I'll do is I'll keep that default path here for this Java Development Kit, which is required under the hood. And as always try to keep that default path, if double click next, then you can chose the theme of the editor. It's not too important because I won't use Android studio for writing code here anyways, we just use it under the hood or a Flutter. We'll use it under the hood for building our Android apps, but still I'll choose that dark mode here, click next. And then here very important, make sure you do install an Android version year. In my case, I'll install API 30 that you do install the Android SDK and that you do install the Android virtual device here. And if you have the option also install into HAXM. Now you might not be able to select this and that's fine as well. You don't need it, but if you can install it definitely do because this will speed up this virtual Emulator later and simply make it run a bit smoother. So basically here, you wanna check all these options and click next. Then here you can leave these defaults for allocating memory to the Emulator. So to this virtual Android device, which we will soon run on our system, click next and click finish, and the this will now download and install more tools under the hood. So therefore again, this can take a couple of minutes to finish and I'll be back once it did finish. No set up this finished for me here. So I'll finish this here and now what we can do on this opening or this welcome screen here is first of all, we can go to the STK Manager by clicking on configure STK Manager. And there you can install any missing pieces that you might still need though, with that default setup, we chosen the wizard we should be fine. The only thing I do recommend here is that you go to SDK tools and you choose the Android SDK Command-Line Tools here. You should install those as well since that can actually a wide some unnecessary errors later, but that should be all you need to install right now. So I'll choose that here and click, OK, again, click here and accept the license and click next. And this will now again, download and install this extra utility software, which we need. So let's wait for this to finish. And once this did finish, we can click finish. And then again, on this welcome screen, click on configure AVD Manager, by the way, you should get this welcome screen whenever you start Android studio. So that's how you can get back there if you don't see it. And then there click on configure AVD Manager, that is where you can manage the virtual devices. So the virtual Android Emulators, you can run on your system. And these are basically virtual Android phones or tablets, which you can run on your computer to test Android apps on them, so that you don't need a real Android phone for testing and also so that you can easily configure different virtual phones on which you can test your Android apps. So that's a very useful tool which we'll use during development to preview our Flutter app on Android. Now you might have a default phone already, if not, you can click on create virtual device and choose any device blueprint you want. Like the pixel free here. That's what I'll use click on next. And then choose an Android version you wanna install there and I'll use the latest stable version at the moment and click download here to install that well operating system for this Emulator, which again can take a short while since it's big. So let's wait for this to finish. Here we go. Now that's finished and now I can choose this Android version, click next and then finish setting up this blueprint. And now I can start this phone by clicking on this play button here to launch this virtual Android device and will need such a virtual Android device to simply preview and test the Flutter app that we're building on Android. Now this can take a while until this started up, but for the moment, we can already go back to the official docs and continue here. By the way, we can also connect a real Android device to our system and run our Flutter app on that. But we'll not do that right now instead we will do that later in the course. So we'll ignore this set up your Android device part for now and we did already set up our Emulator here. So that should already all be fine though you can also go through these written steps again, if you want to. Now the Emulator is up and running for me here, and now it's time to go back to the command prompt and in there run Flutter doctor again, now that we did set up Android a bit more and so on, and this now looks better though we still got a warning regarding the Android toolchain and that warning tells us that we need to accept some extra Android licenses. It also shows us the command we have to run for that and that's the convenient thing about Flutter doctor it very often shows you fix this you can use if certain issues are detected, we can see that we, for example, get a connected device now though. So now here I will simply run Flutter doctor --Android - licenses as recommended here and hit enter. And then this will now automatically accept all those Android licenses to be precise it, asks me whether I wanna accept and I'll type y here for yes, all the time, every time I'm prompted to accept all those licenses. And now with that finished. If you did get an error here make sure you installed those Android Command-Line Tools I showed you a couple of minutes ago through the SDK Manager inside of Android Studio. And now by doing that, if we now run Flutter doctor again, we now finally should have a working Android setup. That looks good. So we now went through this step here and we won't continue with Windows setups since we will focus on building mobile apps with Flutter in this course and therefore now we installed Flutter and Android studio, we've got all these tools set up. In the next lecture we'll now create a new Flutter project and set up our development environment and run this Flutter app on our Emulator.