Keywords
Domains:
Dart
The following table lists the words that the Dart language treats specially.
abstract 2as 2assertasync 1await 3breakcasecatchclassconstcontinuecovariant 2defaultdeferred 2dodynamic 2elseenumexport 2extendsexternal 2factory 2falsefinalfinallyforFunction 2get 2hide 1if |
implements 2import 2ininterface 2islibrary 2mixin 2newnullon 1operator 2part 2rethrowreturnset 2show 1static 2superswitchsync 1thisthrowtruetrytypedef 2varvoidwhilewithyield 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 to the asynchrony support that was added after Dart’s 1.0 release. You can’t use
awaitoryieldas an identifier in any function body marked withasync,async*, orsync*.
All other words in the table are reserved words, which can’t be identifiers.
Semantic portal