Keywords

Domains: Dart

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

abstract 2
as 2
assert
async 1
await 3
break
case
catch
class
const
continue
covariant 2
default
deferred 2
do
dynamic 2
else
enum
export 2
extends
external 2
factory 2
false
final
finally
for
get 2
hide 1
if
implements 2
import 2
in
interface 2
is
library 2
mixin 2
new
null
on 1
operator 2
part 2
rethrow
return
set 2
show 1
static 2
super
switch
sync 1
this
throw
true
try
typedef 2
var
void
while
with
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 to the asynchrony support that was added after Dart’s 1.0 release. You can’t use await or yield as an identifier in any function body marked with async, async*, or sync*.

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

Similar pages

Page structure
Terms

Dart

Functions

Set