Environment setup
Learning objectives
- You have a local development environment that works.
So far in the course, we've worked on the applications within the programming environment embedded to the materials. As the applications become larger, this becomes more cumbersome. In addition, the embedded programming environment is limited in packages that it supports. To proceed, there's a need for a local development environment.
VSCode and alternatives
Here, we'll use VSCode. If you for some reason do not want to use it, there are also alternatives such as Android Studio.
Course tools
The tools for this course are outlined in tooling and working practices. If you haven't installed Visual Studio Code (VS Code), Dart, or Flutter, now is the time to do so.
Once you have them available locally, you may proceed.
Flutter VSCode plugin
To add Flutter to VSCode, click the menu bar element View
. This opens up a menu that offers, among other things, an option Command Palette
. Click it.
This opens up a text area that allows typing in text; VS Code suggests commands based on these.
When you write install
, you'll see a list of commands that contain the text install
. Click the option Extensions: Install Extensions
.
When you click on the option Extensions: Install Extensions
, a list of option pops up on the left hand side. The list contains extensions that you can add to the programming environment.
You can filter extensions by typing in text to the top of the left hand side menu. When you write flutter
, you'll see options that include the word flutter
. You should also see the Flutter
plugin that provides support for developing Flutter applications.
Install the Flutter
plugin by pressing the associated Install
button and wait until it has been installed. It is installed when the plugin on the left hand side no longer shows the Install
button.
Once Flutter has been installed, it is time to check that things are in order. Click the menu bar element View
again, and again, choose the option Command Palette
. Write doctor
to the text area.
You should see the option Flutter: Run Flutter Doctor
. Flutter Doctor is a program that checks the support for Flutter in the environment.
Run the command Flutter: Run Flutter Doctor
. When you run it, you might see an error that Flutter SDK is not found.
If you have already installed Flutter SDK (check the course tools), try restarting VS Code. Otherwise, install Flutter SDK.