Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL SQLITE MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST DART PLAYWRIGHT TOOLS MATH SHEETS POWER BI

Dart Tutorial

Dart HOME Dart Intro Dart Get Started Dart Syntax Dart Output Dart Comments Dart Variables Dart final and const Dart Data Types Dart Numbers Dart Strings Dart String Interpolation Dart String Methods Dart Booleans Dart Type Conversion Dart Null Safety Dart late Dart Operators Dart Arithmetic Dart Assignment Dart Comparison Dart Logical Dart Type Test Dart Null Operators Dart Cascade Dart If...Else Dart Switch Dart While Loop Dart For Loop Dart Break/Continue

Dart Collections

Dart Lists Dart Access List Items Dart Change List Items Dart Loop Lists Dart List Methods Dart Sets Dart Maps Dart Access Map Items Dart Loop Maps Dart Collection if/for Dart Spread Operator

Dart Functions

Dart Functions Dart Parameters Dart Named Parameters Dart Return Values Dart Arrow Functions Dart Anonymous Functions Dart Closures Dart Scope Dart Recursion

Dart Classes

Dart OOP Dart Classes/Objects Dart Constructors Dart Named Constructors Dart Factory Constructors Dart Getters and Setters Dart Static Members Dart Inheritance Dart Abstract Classes Dart Interfaces Dart Mixins Dart Extension Methods Dart Enums Dart Generics

Dart 3 Features

Dart Records Dart Patterns Dart Switch Expressions Dart Sealed Classes Dart Class Modifiers

Dart Errors

Dart Exceptions Dart Custom Exceptions

Dart Async

Dart Async Intro Dart Futures Dart async/await Dart Streams Dart Isolates

Dart Libraries

Dart Imports Dart Packages Dart Math Dart Dates Dart JSON Dart RegExp Dart User Input Dart Files Dart Testing

Dart Examples

Dart Examples Dart Exercises


Dart Exercises


Share

Test your Dart skills with exercises from all chapters.

Every lesson page also ends with its own short exercise.

Exercises

Tip: Sign in to track your progress.

0/84 done

Introduction4 exercises

Done

Get Started4 exercises

Done

Syntax4 exercises

Done

Output4 exercises

Done

Comments4 exercises

Done

Variables4 exercises

Done

final and const4 exercises

Done

Data Types4 exercises

Done

Numbers4 exercises

Done

Strings4 exercises

Done

String Interpolation4 exercises

Done

String Methods4 exercises

Done

Booleans4 exercises

Done

Type Conversion4 exercises

Done

Null Safety4 exercises

Done

late4 exercises

Done

Operators4 exercises

Done

Arithmetic Operators4 exercises

Done

Assignment Operators4 exercises

Done

Comparison Operators4 exercises

Done

Logical Operators4 exercises

Done

Type Test Operators4 exercises

Done

Null-aware Operators4 exercises

Done

Cascade Notation4 exercises

Done

If...Else4 exercises

Done

Switch4 exercises

Done

While Loop4 exercises

Done

For Loop4 exercises

Done

Break and Continue4 exercises

Done

Lists4 exercises

Done

Access List Items4 exercises

Done

Change List Items4 exercises

Done

Loop Lists4 exercises

Done

List Methods4 exercises

Done

Sets4 exercises

Done

Maps4 exercises

Done

Access Map Items4 exercises

Done

Loop Maps4 exercises

Done

Collection if and for4 exercises

Done

Spread Operator4 exercises

Done

Functions4 exercises

Done

Function Parameters4 exercises

Done

Named Parameters4 exercises

Done

Return Values4 exercises

Done

Arrow Functions4 exercises

Done

Anonymous Functions4 exercises

Done

Closures4 exercises

Done

Scope4 exercises

Done

Recursion4 exercises

Done

OOP4 exercises

Done

Classes and Objects4 exercises

Done

Constructors4 exercises

Done

Named Constructors4 exercises

Done

Factory Constructors4 exercises

Done

Getters and Setters4 exercises

Done

Static Members4 exercises

Done

Inheritance4 exercises

Done

Abstract Classes4 exercises

Done

Interfaces4 exercises

Done

Mixins4 exercises

Done

Extension Methods4 exercises

Done

Enums4 exercises

Done

Generics4 exercises

Done

Records4 exercises

Done

Patterns4 exercises

Done

Switch Expressions4 exercises

Done

Sealed Classes4 exercises

Done

Class Modifiers4 exercises

Done

Exceptions4 exercises

Done

Custom Exceptions4 exercises

Done

Async Intro4 exercises

Done

Futures4 exercises

Done

async and await4 exercises

Done

Streams4 exercises

Done

Isolates4 exercises

Done

Imports4 exercises

Done

Packages4 exercises

Done

Math4 exercises

Done

Dates4 exercises

Done

JSON4 exercises

Done

RegExp4 exercises

Done

User Input4 exercises

Done

Files4 exercises

Done

Testing4 exercises

Done

Log in to track your progress

If you haven't already, sign up to become a W3Schooler, and get points for every exercise you complete.

As a logged on W3Schools user you will have access to many features like having your own web page, track your learning progress, receive personal guided paths, and more.


The Exercise

The exercises are a mix of "multiple choice" and "fill in the blanks" questions. There are between 3 and 9 questions in each category. The answer can be found in the corresponding tutorial chapter. If you're stuck, or answer wrong, you can try again or hit the "Show Answer" button to see the correct answer.

If you are new to Dart, start with our Dart Tutorial from the beginning.




Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by W3Schools. All Rights Reserved. W3Schools is Powered by W3.CSS.