0%
Organizing a Dart Project — Chapter 16

Chapter 16 — Organizing a Dart Project

Part 1A — Learning Dart · Chapter 16 of 62 · 6 h

Chapter 16 — Organizing a Dart Project

Level: beginner / intermediate Estimated time: 6 h Prerequisites: Chapter 15 — Asynchronous Programming (Future, async, await) What you will be able to do by the end: install Dart on your machine, create a real project with dart create, split it into multiple files, add packages from pub.dev, analyze it, format it, test it, and compile it into an executable.


16.0 — Chapter Objectives

By the end of this chapter, you will be able to:

  • explain why DartPad is no longer enough past a certain point;
  • say what the Dart SDK contains;
  • install Dart on Windows, macOS, or Linux and verify the installation;
  • install VS Code and the Dart extension;
  • create a project with dart create mon_jeu;
  • choose between the console and package templates;
  • name each folder in a Dart project and say what it is for;
  • run a program with dart run;
  • analyze your code with dart analyze;
  • format your code with dart format;
  • produce an executable with dart compile exe;
  • read and write a pubspec.yaml file, field by field;
  • understand the role of pubspec.lock;
  • explain what a package is and browse pub.dev;
  • add a dependency with dart pub add;
  • distinguish between dependencies and dev_dependencies;
  • read a version constraint and understand the caret ^;
  • write the three forms of import (dart:, package:, relative path);
  • filter an import with show and hide;
  • prefix an import with as;
  • split code into one class per file;
  • explain part / part of and why it is avoided;
  • create a "barrel" file with export;
  • understand the scope of a private _ member at the file level;
  • configure analysis_options.yaml and enable lints;
  • write a first test with package:test and run it with dart test;
  • write a correct .gitignore for a Dart project;
  • organize a clean project from start to finish.

Comments

Comments are powered by GitHub Discussions

Sign in with GitHub to join the discussion

Link copied!