The main() Function in Dart


The main() function in dart is top-level unique function. Every app or program written in dart must have main() function.


The main() function is an entry point for an application or program. Return type of main() is void and it accepts optional List<String> parameter for arguments.

Example


void main() {
  print("I am entry point for an app!");
}

Output

I am entry point for an app!