Keywords

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

abstract 2dynamic 2implements 2show 1
as 2elseimport 2static 2
assertenuminsuper
async 1export 2interface 2switch
await 3extendsissync 1
breakexternal 2library 2this
casefactory 2mixin 2throw
catchfalsenewtrue
classfinalnulltry
constfinallyon 1typedef 2
continueforoperator 2var
covariant 2Function 2part 2void
defaultget 2rethrowwhile
deferred 2hide 1returnwith
doifset 2yield 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.