ePrivacy and GPDR Cookie Consent by CookieConsent.com
menu

Keywords in dart language

Keywords in dart are the reserved words which can be used only for a specific place and do some specific task. 
Keywords are predefined words that's why they cannot be used as a variable, function name, or class name.
In dart, there are a total of  61 keywords which are used by the programmers.

Dart keywords are following 

  1. abstract:  "abstract keyword is used for creating abstract classes in Dart. An abstract class means a class that can't be instantiated."
  2. as: "as keyword is used for type checking and at run time and also used for typecasting "
  3. assert: "assert keyword disrupts the execution of a block of code if the given condition is false"
  4. async: "async keyword is used for asynchronous programming  i.e. Future and Stream"
  5. await: "await keyword is used with the async keyword for asynchronous programming  i.e. Future and Stream"
  6. break: "break keyword is used for stopping the loop. Break keyword is used to stop loop execution on a specific condition"
  7. case: "case keyword is used in the switch statement to execute code in a particular case"
  8. catch: "catch keyword is used for catching the error which is thrown by the try statement. This must be used after try block"
  9. class:  "class keyword is used to create classes in dart"
  10. const: "const keyword is used for declaring compile-time constant"
  11. continue:  "continue keyword is used to skip the next loop iteration. It continues the current flow of the program and skips the remaining code after the specific condition "
  12. covariant:  "Some (rarely used) coding patterns rely on tightening a type by overriding a parameter’s type with a subtype, which is invalid. In this case, you can use the covariant keyword to tell the analyzer that you are doing this intentionally. docs"
  13. default: "The default keyword in dart is used when no case matches in switch statement"
  14. deferred:  "deferred is used in webPage to load a library on-demand when it is needed to be used."
  15. do:  "This dart keyword is used to declare a loop. It can iterate a part of the program several times."
  16. dynamic:  "dynamic keyword is used to declare such kind of variable whose type can change on-demand."
  17. else: "else keyword in dart is used as an alternate branch of if statement"
  18. enum:  "Enumerated types, often called enumerations or enums, are a special kind of class used to represent a fixed number of constant values"
  19. export:  "export keyword is used for sending something from a dart file to another dart file."
  20. extends:  "extends keyword in dart is used for creating a subclass."
  21. extension: "extension keyword is used for adding some additional functionality into the existing library."
  22. external: "external function is a function whose body is provided separately from its declaration."
  23. factory:  "factory keyword in dart is used when implementing a constructor that does not always create a new instance of its class."
  24. false:  "false literal in the dart programming language is a bool type."
  25. final:  "keyword is used for creating run-time constant."
  26. finally:  "finally keyword is used after a try-catch statement. This block always runs whether the try or catch block run or not "
  27. for:  "the for keyword is used for creating a for loop. This repeats the block of code as you ordered."
  28. function: "function keyword in dart is used for creating a function."
  29. get: "get keyword is used for implementing getters."
  30. hide: "hide keyword in dart is used when you are importing a library but you don't want to import any specific thing."
  31. if:  "if keyword in dart is used for creating conditionals and executes the block of code if the given condition is true."
  32. implements:  "implements keyword is used when a class implements one or more interfaces."
  33. import:  "import keyword is used when we want variables, functions, classes, etc from another dart library or file."
  34. in: "in keyword in dart is used for for-in loop."
  35. interface: "This keyword has been removed for the dart language."
  36. is:  "is keyword in dart is a type test operator which results true if the object has specified type."
  37. library:  "library is used for creating a sharable code base."
  38. mixin:  "mixins are a way of reusing class code in multiple class hierarchies "
  39. new:  "new keyword in dart is used for creating a new object. But now it is optional."
  40. null:  "the new keyword in dart is used for showing that the reference does not refer to anything."
  41. on:  "on keyword is used when we need to specify the exception type."
  42. operator:  "operators perform actions on single or multiple operands (ex. 1+2) as we desire."
  43. part: "part in dart is used for creating library into multiple dart files."
  44. rethrow:  "rethrow keyword is used for propagating the error inside the catch block"
  45. return: "return keyword in dart is used to return from a method when the execution is completed"
  46. set:  "set keyword in dart is used for implementing setters"
  47. show:  "show keyword is used to import the library selectively."
  48. static:  "static keyword indart is used for implementing class-wide variables and methods."
  49. super:  "super keyword is used to refer the parent class in inheritance."
  50. switch:  "switch keyword in dart is used for executing the block of code in some test values."
  51. sync:  "sync in dart  is a generator function that returns an iterable object "
  52. this: "this keyword in dart is used to refer the current object in a method or constructor."
  53. throw:  "throw keyword is used to declare an exception. Checks the exceptions and then throws an error."
  54. true: "true literal in the dart programming language is a bool type."
  55. try:  "try keyword in dart is used to declare a block of code and check for errors"
  56. typedef:  "A typedef, or function-type alias, gives a function type a name that you can use when declaring fields and return types"
  57. var: "var keyword in dart is used for creating a variable."
  58. void:  "void keyword is used as the return type of function when the function does not return anything."
  59. while:  "while keyword in dart is used for creating a while loop. This loop iterates a part of the program several times. If the number of iteration is not fixed, it is recommended to use a while loop."
  60. with:  "with keyword in dart is used for creating mixins."
  61. yield:  "yield keyword is used in synchronous generators to deliver values."

Comments