Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Set up your first Dart project on Linux

    Jermaine OppongJermaine Oppong

    We will setup our first command-line Dart application. We will use the apt-get package manager on Ubuntu to install the SDK and write our first program. This will prepare you to follow along in the next lessons.

    Get the gist of commands → https://gist.github.com/creativebracket/b44ee73739f249be0d5f4b8676e8eca5



    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson




    Instructor: We'll begin by running sudo apt-get update to update the package repository listings configured on our system. Install apt transport HTTPS to allow us access to repositories using the HTTPS protocol. Add the Google Linux sign in key to your apt key list to allow us to register the dot repository.

    You may need to install the curl package if it's not already installed. Then try the command again. Then register the dot repository. This will now allow us to install the dot SDK.

    To install the development version of the dot SDK, register the unstable dot repo instead. Then run the same command to install dot. You can confirm you have dot installed by going directly to the bin directory. After installing the SDK, add its bin directory to your path environment variable.

    Now you should be able to use the dot command directly. In your working folder, create a pubspec.yaml file. A pubspec file contains meta data and configuration related to a dot project.

    We will enter the minimum information about our project such as the name, description, and an author. All starting files go in a bin folder. Let's create one containing a main.dot file. In this file we will define a top level function called main. Dot requires this function to start our application. In this function we'll print the current date time. Save the file and run. This completes the lesson.