void main() { 
   ..text = 'Click me!' 
// Run the app like this: dart args.dart 1 test 
void main(List<String> arguments) { 
   assert(arguments.length == 2); 
   assert(int.parse(arguments[0]) == 1); 
   assert(arguments[1] == 'test'); 

Every app must have a top-level main() function, which serves as the entrypoint to the app.

The main() function returns void and has an optional List<String> parameter for arguments.

Related concepts

main() — Structure map

Clickable & Draggable!

main() — Related pages: