Dart Keywords
Reserve words with specific meaning for the compiler are called dart keywords. It is not permitted to be used as the name of a class, function, or variable. It is necessary to write keywords exactly as described because they are case sensitive. The Dart contains 61 keywords. A few of them are unique, while the most are probably well-known to you already. The list of the provided Dart keywords is shown below.
abstract2 | else | import2 | super |
as2 | enum | in | switch |
assert | export2 | interface2 | sync1 |
async1 | extends | is | this |
await3 | extension2 | library2 | throw |
break | external2 | mixin2 | true |
case | factory | new | try |
catch | false | null | typedef2 |
class | final | on1 | var |
const | finally | operator2 | void |
continue | for | part2 | while |
covarient2 | Function2 | rethrow | with |
default | get2 | return | yield3 |
deffered2 | hide1 | set2 | |
do | if | show1 | |
dynamic2 | implements2 | static2 |
A few keywords (1, 2, and 3) in the list of keywords above are indicated by the superscript. We are going to define the superscript’s purpose in the following.
- Subscript 1: Contextual keywords are what these terms refer to. They are utilized in specific locations and have unique meanings.
- Subscript 2: We refer to these terms as built-in identifiers. These keywords can be used as legitimate identifiers when migrating JavaScript code for Dart, however they cannot be used as import prefixes or in class names, functions, or names of functions.
- Subscript 3: New keywords associated with the asynchrony
In the future tutorials, we will go into further detail about these keywords.