Skip to content

Dart - Wyatt's Notes

Dart programming language notes covering fundamentals, advanced concepts, and practical examples.

sources:

  • text: Standard textbook reference

Dart is a programming language with a rich type system and ecosystem. These notes cover the language from fundamentals to advanced topics, with worked examples, practice problems, and flashcards.

Why This Matters

Dart is the language behind Flutter, Google’s cross-platform UI framework for building mobile, web, and desktop applications from a single codebase. Understanding Dart’s type system, async model, and compilation pipeline is essential for building performant Flutter apps. Beyond Flutter, Dart’s strengths in AOT compilation, sound null safety, and isolate-based concurrency make it a capable general-purpose language.

Topics

Intuition

Dart and Flutter enable cross-platform app development from a single codebase: Write once, deploy to iOS, Android, web, and desktop. Dart’s compilation to native code ensures performance close to platform-specific development.

Why it matters: Cross-platform development dramatically reduces development time and cost while reaching users on all major platforms.

The key insight: Flutter’s hot reload feature transforms the development experience — see changes instantly without losing app state, enabling rapid iteration.

Common Mistakes

Confusing Dart with JavaScript: Dart has a sound type system, AOT compilation for production, and different concurrency model (isolates, not threads). Do not assume JavaScript patterns (prototypal inheritance, dynamic typing) apply to Dart.

Skipping dart analyze before running code: The Dart analyzer catches type errors, unused imports, and API misuse at compile time. Running code without checking analysis output leads to runtime errors that could have been caught earlier.

Not using dart format consistently: Dart has an official code formatter. Inconsistent formatting across a team makes code reviews harder and introduces unnecessary diff noise. Always run dart format . before committing.

Cross-References

  • Site Home: Main landing page for dart notes.
  • Practice: Practice problems for revision.