⚠️ This lesson is retired and might contain outdated information.

Set up your first Dart project on Linux

Jermaine Oppong
InstructorJermaine Oppong
Share this video with your friends

Social Share Links

Send Tweet
Published 5 years ago
Updated 2 years ago

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

Instructor: [00:00] 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.

[00:26] 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.

[00:52] 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.

[01:15] 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.

[01:30] 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.

egghead
egghead
~ a minute ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today