Anatomy of Dart Functions

on Saturday, 18th of July, 2020

Functions look familiar in Dart if you're coming from any C-like language. The anatomy of a function is pretty straightforward:

String makeGreeting(String name) { 
  return 'Hello, $name';
}

The first line in the function is the signature. It defines the return type of the function, the function name, and lists all arguments the function requires or accepts.

The function sig



Join thousands of Flutter developers.

Sign up for infrequent updates about Flutter and Dart.

You can get all this content and more in one place. Check out my new book Flutter in Action