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 withdart 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
consoleandpackagetemplates; - 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.yamlfile, 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
dependenciesanddev_dependencies; - read a version constraint and understand the caret
^; - write the three forms of
import(dart:,package:, relative path); - filter an import with
showandhide; - prefix an import with
as; - split code into one class per file;
- explain
part/part ofand why it is avoided; - create a "barrel" file with
export; - understand the scope of a private
_member at the file level; - configure
analysis_options.yamland enable lints; - write a first test with
package:testand run it withdart test; - write a correct
.gitignorefor 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