Become a member
to unlock all features

Level Up!

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


    Setup your first Dart project on Windows


    We will setup our first command-line Dart application. We will use the Chocolatey package manager to install the SDK and write our first program. This will form the basis for future lessons.

    Get Chocolatey → https://chocolatey.org/docs/installation

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



    Become a Member to view code

    You must be a Pro 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
    orLog In




    Instructor: Using the Chocolatey package manager, we can install the Dart SDK by running choco install dart-sdk. Alternatively, you can install the Dev Channel version by passing the pre flag. To upgrade a pre-existing Dart installation, run choco upgrade dart-sdk.

    Restart your command prompt in order to confirm your Dart installation. Confirm Dart is properly installed by typing the dart command and passing the version flag.

    In your working folder, create a pubspec.yaml file. A pubspec file contains metadata and configuration related to a Dart project. We will enter the minimum information about our project, such as a name, description, and an author.

    All starting files go in a bin folder. Let's create one containing a main.dart file. In this file, we will define a top-level function called main. Dart requires this function to start our application. Save the file and run. This completes the lesson.