Dart Programming - Defining a Function

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() {  


void function_name() { 

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"); }