🌍 Flutter · subject

Flutter Dart Programming Syllabus

The Dart Programming syllabus for Flutter in full: 4 chapters, 13 topics and 37 sub-topics, every one listed below, plus 51 Dart Programming flashcards with answers.

4Chapters
13Topics
37Sub-topics
51Flashcards

Dart Programming syllabus: all 4 chapters

Expand any chapter to see its topics and sub-topics.

  1. Introduction to Dart

    1 topic
    • What is Dart?
      • History of Dart
      • Dart vs Other Languages
      • Why Dart for Flutter?
  2. Dart Basics

    3 topics
    • Syntax and Structure
      • Variables and Data Types
      • Operators
      • Control Flow Statements
    • Functions
      • Defining Functions
      • Function Parameters
      • Anonymous Functions
      • Arrow Functions
    • Error Handling
      • Try-Catch-Finally
      • Custom Exceptions
  3. Object-Oriented Programming in Dart

    5 topics
    • Classes and Objects
      • Defining Classes
      • Creating Objects
      • Constructors
      • Instance Variables and Methods
    • Inheritance
      • Extending Classes
      • Method Overriding
      • Super Keyword
    • Mixins and Abstract Classes
      • Using Mixins
      • Creating Abstract Classes
    • Interfaces
      • Implementing Interfaces
      • Difference Between Interfaces and Abstract Classes
    • Enums
      • Defining Enums
      • Using Enums
  4. Advanced Dart Concepts

    4 topics
    • Asynchronous Programming
      • Future and Async-Await
      • Streams
      • Handling Asynchronous Errors
    • Generics
      • Defining Generics
      • Using Generics in Collections
      • Generic Methods
    • Dart Packages
      • Using Pub Package Manager
      • Creating and Publishing Packages
    • Data Collections
      • Lists
      • Sets
      • Maps
      • Iterators

Flutter Dart Programming flashcards — 51 questions with answers

  1. What is Dart and who developed it?

    Dart is an open-source, client-optimized programming language developed by Google. It is designed for building fast apps on any platform (mobile, web, desktop, server) and is the language used to write Flutter apps.

  2. What are the two main compilation modes Dart supports, and where is each used?

    JIT (Just-In-Time) compilation is used during development for hot reload and fast iteration. AOT (Ahead-Of-Time) compilation compiles to fast, predictable native machine code for production release builds.

  3. Is Dart statically or dynamically typed, and what feature relaxes explicit typing?

    Dart is statically typed (types checked at compile time), but it provides type inference. The 'var' keyword lets the compiler infer the type, and 'dynamic' opts out of static checking entirely.

  4. What is the entry point of every Dart program?

    The top-level 'main()' function. Execution begins there; it can optionally take a List<String> of command-line arguments: 'void main(List<String> args) {}'.

  5. In Dart, what is the difference between 'final' and 'const'?

    'final' means the variable can be assigned only once and is set at runtime. 'const' is a compile-time constant that must be known at compile time and is deeply immutable. Every const is implicitly final.

  6. What is Dart's sound null safety, and what do '?' and '!' mean?

    Sound null safety makes types non-nullable by default, so variables cannot hold null unless declared nullable with '?' (e.g. String?). The '!' null-assertion operator asserts a nullable value is non-null, throwing at runtime if it is null.

  7. What does the null-aware access operator '?.' do in Dart?

    It safely accesses a member only if the receiver is non-null; if the receiver is null, the whole expression evaluates to null instead of throwing. Example: 'user?.name'.

  8. What is the null-coalescing operator '??' in Dart, and its assignment form '??='?

    'a ?? b' returns 'a' if it is non-null, otherwise 'b'. 'a ??= b' assigns 'b' to 'a' only if 'a' is currently null.

  9. What are Dart's built-in numeric types and their relationship?

    Dart has 'int' (integers) and 'double' (64-bit floating point). Both are subtypes of 'num'. An int can be assigned to a num or double variable, but a double is not automatically an int.

  10. How do you write a single-line and a multi-line comment, plus a documentation comment, in Dart?

    Single-line: '// comment'. Multi-line: '/* ... */'. Documentation comment: '/// doc comment' (or '/** */'), used by dartdoc to generate API docs.

  11. What is string interpolation in Dart and its syntax?

    Embedding expressions inside string literals using '$'. Use '$variable' for a simple identifier and '${expression}' for any expression. Example: 'Hello $name, sum is ${a + b}'.

  12. What is the difference between required and optional named parameters in a Dart function?

    Named parameters are written in braces, e.g. 'f({int? a, required int b})'. By default named params are optional and nullable; adding 'required' forces the caller to provide them. Optional ones can also have default values.

  13. How do you declare optional positional parameters with defaults in Dart?

    Wrap them in square brackets and optionally give defaults: 'void f(int a, [int b = 0, String c = "x"]) {}'. The caller may omit trailing positional optionals.

  14. What is an arrow function (fat-arrow syntax) in Dart?

    A shorthand for a function whose body is a single expression: '=> expr' is equivalent to '{ return expr; }'. Example: 'int square(int x) => x * x;'.

  15. What is a first-class function in Dart, and what type represents a function?

    Functions are first-class objects: they can be assigned to variables, passed as arguments, and returned from other functions. The 'Function' type (or a typedef) represents a function value.

  16. What is a closure in Dart?

    A closure is a function object that captures and retains access to variables in its lexical scope, even when the function is used outside that scope. Each closure keeps its own copy of the captured state.

  17. How does Dart's exception handling try/catch/finally work?

    Code that may fail goes in 'try'. 'catch (e)' or 'on ExceptionType catch (e, s)' handles errors (e = object, s = stack trace). 'on Type' filters by type. 'finally' always runs whether or not an exception occurred.

  18. In Dart, what is the difference between 'Exception' and 'Error'?

    'Exception' represents conditions a program can reasonably anticipate and recover from (e.g. FormatException). 'Error' represents programming mistakes that should not be caught (e.g. RangeError, AssertionError), indicating bugs to fix.

  19. How do you throw an exception in Dart, and can you throw arbitrary objects?

    Use the 'throw' keyword: 'throw FormatException("bad");'. Dart lets you throw any non-null object, but throwing an Exception or Error subclass is the recommended convention.

  20. What does the 'rethrow' keyword do in a Dart catch block?

    'rethrow' re-throws the currently caught exception, preserving its original stack trace, so an outer handler can process it after the inner block does partial handling.

Show the other 31 Dart Programming flashcards
  1. What is the purpose of the 'assert' statement in Dart, and when does it run?

    'assert(condition, [message])' throws an AssertionError if the condition is false. It runs only in development/debug mode and is stripped out in production (AOT) builds, so it has no runtime cost in release.

  2. What is a class in Dart, and what are the two implicit members every object has?

    A class is a blueprint defining fields (state) and methods (behavior) for objects. Every object implicitly has a 'runtimeType' (its Type) and a 'hashCode', and inherits members from the root class 'Object'.

  3. What is a constructor in Dart, and what is the shorthand for assigning fields from parameters?

    A constructor initializes a new object; by default it shares the class name. The shorthand 'ClassName(this.x, this.y);' automatically assigns constructor arguments directly to the instance fields x and y.

  4. What are named constructors in Dart, and give an example use.

    Named constructors let a class have multiple constructors using 'ClassName.identifier(...)'. Example: 'Point.origin() : x = 0, y = 0;' provides an alternative way to construct an object with clear intent.

  5. What is a factory constructor in Dart and how does it differ from a normal constructor?

    A 'factory' constructor does not always create a new instance; it can return an existing/cached object or an instance of a subtype. Unlike a generative constructor, it has no automatic 'this' and must explicitly return an object.

  6. What is an initializer list in a Dart constructor?

    Code after ':' that runs before the constructor body to initialize final fields, call super constructors, or assert conditions. Example: 'Point(int x, int y) : distance = sqrt(x*x + y*y) { }'.

  7. What are getters and setters in Dart?

    Special methods providing read/write access to a property. 'get' defines a computed read-only property ('int get area => w * h;') and 'set' defines a write property ('set width(int v) => _w = v;'), used with normal field-access syntax.

  8. What is the difference between instance members and static members in a Dart class?

    Instance members belong to each object and access 'this'. Static members (declared with 'static') belong to the class itself, are shared across all instances, and are accessed via the class name without creating an object.

  9. How does single inheritance work in Dart and what keyword is used?

    A subclass extends exactly one superclass with the 'extends' keyword, inheriting its fields and methods. Example: 'class Dog extends Animal {}'. Dart supports single inheritance of implementation.

  10. What does the 'super' keyword do in Dart inheritance?

    'super' refers to the superclass. It is used to call the parent's constructor (e.g. ': super(name)') and to invoke overridden parent methods or access parent members (e.g. 'super.speak()').

  11. What is method overriding in Dart, and what annotation is recommended?

    A subclass redefines an inherited method with the same signature to provide specialized behavior. The '@override' annotation documents intent and lets the analyzer verify a member actually overrides a superclass member.

  12. In Dart, in what order are superclass and subclass constructors executed?

    The superclass constructor runs before the subclass constructor body. Order: subclass initializer list -> superclass constructor -> subclass constructor body. If not called explicitly, the default 'super()' is invoked automatically.

  13. What is a mixin in Dart and what keyword applies one?

    A mixin is a way to reuse a class's code in multiple class hierarchies without inheritance. You define it with 'mixin' and apply it using the 'with' keyword: 'class Duck extends Bird with Swimmer, Flyer {}'.

  14. How does a mixin differ from ordinary inheritance in Dart?

    A class extends only one superclass but can mix in many mixins with 'with', enabling horizontal code reuse across unrelated hierarchies. Mixins add behavior without establishing an is-a parent-child relationship, and typically cannot be instantiated on their own.

  15. What is the 'on' clause in a Dart mixin declaration?

    'mixin M on SuperType' restricts the mixin so it can only be applied to classes that extend or implement SuperType, guaranteeing the mixin access to that type's members.

  16. What is an abstract class in Dart and can it be instantiated?

    An abstract class (declared 'abstract class') defines a common interface and may contain abstract methods (no body) plus concrete methods. It cannot be instantiated directly; concrete subclasses must implement its abstract members.

  17. What is an abstract method in Dart?

    A method declared without an implementation (ending in ';' instead of a body) inside an abstract class. Every non-abstract subclass must provide a concrete override of it.

  18. How does Dart implement interfaces, given it has no 'interface' keyword traditionally?

    Every class implicitly defines an interface consisting of its public members. Another class uses 'implements' to adopt that contract and must provide concrete implementations of ALL of its members. A class can implement multiple interfaces.

  19. What is the difference between 'extends' and 'implements' in Dart?

    'extends' inherits the superclass's implementation (you may override selectively). 'implements' inherits only the contract/interface: you must re-implement every member yourself and no implementation is inherited.

  20. What is an enum (enumeration) in Dart?

    A special class representing a fixed set of named constant values. Example: 'enum Color { red, green, blue }'. Each value is a constant instance; you compare and switch over them for type-safe fixed choices.

  21. What properties do Dart enum values provide (e.g. index, name, values)?

    Each value has an 'index' (zero-based position) and a '.name' (its string name). The enum type provides a static 'values' list of all members, e.g. 'Color.values', useful for iteration.

  22. What are enhanced enums in Dart (Dart 2.17+)?

    Enhanced enums can declare fields, constructors, methods, and implement interfaces, so each enum value can carry data. Example: 'enum Planet { earth(5.97e24); const Planet(this.mass); final double mass; }'.

  23. What is a Future in Dart asynchronous programming?

    A Future represents the eventual result of an asynchronous operation. It completes either with a value or with an error at some later time, and you react to it using 'await' or '.then()'/'.catchError()'.

  24. What do the 'async' and 'await' keywords do in Dart?

    Marking a function 'async' makes it return a Future and enables 'await' inside it. 'await' suspends execution until the awaited Future completes, then resumes with its value—letting asynchronous code read like synchronous code.

  25. What is the difference between a Future and a Stream in Dart?

    A Future delivers a single asynchronous result (one value or error). A Stream delivers a sequence of asynchronous events over time (zero or more values), consumed with 'await for' or '.listen()'.

  26. How do you consume a Stream's values using async syntax in Dart?

    Inside an 'async' function use 'await for (var value in stream) { ... }' to process each event as it arrives, or call 'stream.listen((value) { ... })' for a callback-based subscription.

  27. What is a generic in Dart and what problem does it solve?

    Generics parameterize a type or function with a type variable (e.g. 'List<T>'), enabling reusable, type-safe code that works with many types while preserving compile-time type checking and avoiding casts.

  28. How do you constrain a generic type parameter in Dart?

    Use 'extends' to bound the type: 'class Cache<T extends Object> {}' or 'T max<T extends Comparable>(T a, T b)'. The bound guarantees the type argument has the members you rely on.

  29. What is a Dart package and what file defines its metadata and dependencies?

    A package is a reusable, shareable unit of Dart code (library or app). Its metadata, dependencies, and SDK constraints are declared in the 'pubspec.yaml' file at the package root.

  30. What is pub.dev and what command adds a dependency to a Dart project?

    pub.dev is the official package repository for Dart and Flutter. You add a dependency with 'dart pub add <package>' (or 'flutter pub add'), then fetch packages with 'dart pub get'.

  31. What are the four core collection types in Dart and their key distinctions?

    List: an ordered, indexable sequence allowing duplicates. Set: an unordered collection of unique items. Map: key-value pairs with unique keys. Iterable: the base interface for List and Set producing elements sequentially. (Runnable comparisons: List is ordered/duplicates; Set is unique; Map is keyed.)

Flutter Dart Programming FAQ

What is in the Flutter Dart Programming syllabus?

Flutter Dart Programming is split into 4 chapters: Introduction to Dart, Dart Basics, Object-Oriented Programming in Dart and Advanced Dart Concepts. Together they contain 13 topics and 37 sub-topics.

How many chapters are in Flutter Dart Programming?

4 chapters, containing 13 topics and 37 sub-topics. The largest chapter is Object-Oriented Programming in Dart, with 5 topics.

Are there flashcards for Flutter Dart Programming?

Yes — a 51-card Dart Programming deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.