Keywords

The following table lists the words that the Dart language treats specially.

abstract 2 dynamic 2 implements 2 show 1
as 2 else import 2 static 2
assert enum in super
async 1 export 2 interface 2 switch
await 3 extends is sync 1
break external 2 library 2 this
case factory 2 mixin 2 throw
catch false new true
class final null try
const finally on 1 typedef 2
continue for operator 2 var
covariant 2 Function 2 part 2 void
default get 2 rethrow while
deferred 2 hide 1 return with
do if set 2 yield 3

Avoid using these words as identifiers.However, if necessary, the keywords marked with superscripts can be identifiers:

  • Words with the superscript 1 are contextual keywords,which have meaning only in specific places.They’re valid identifiers everywhere.
  • Words with the superscript 2 are built-in identifiers.To simplify the task of porting JavaScript code to Dart,these keywords are valid identifiers in most places,but they can’t be used as class or type names, or as import prefixes.
  • Words with the superscript 3 are newer, limited reserved words related tothe asynchrony support that was addedafter Dart’s 1.0 release.You can’t use await or yield as an identifierin any function body marked with async, async, or sync.

All other words in the table are reserved words,which can’t be identifiers.