Dart Programming - Defining a Function


Advertisements

A function definition specifies what and how a specific task would be done. Before using a function, it must be defined. The syntax for defining a standard function is given below −

function_name() {  
   //statements      
}

OR

void function_name() { 
   //statements 
}

The void keyword indicates that the function does not return any value to the caller.

Example - Simple Function Definition

test() { 
   //function definition 
   print("function called"); }
dart_programming_functions.htm
Advertisements