Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Last active October 2, 2019 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcinusX/62c3eff48e55e5ac07c9051b1d26d01e to your computer and use it in GitHub Desktop.
Save MarcinusX/62c3eff48e55e5ac07c9051b1d26d01e to your computer and use it in GitHub Desktop.
int printName(String firstName, [String surname]) {
print(firstName);
if (surname != null) {
print(surname);
}
}
// i wywołamy tę metodę tak:
printName('Adam');
// lub tak
printName('Adam', 'Nowak');
int printNameTwo(String firstName, {String surname}) {
print(firstName);
if (surname != null) {
print(surname);
}
}
// a tę metodę wywołamy tak:
printName('Adam');
// lub tak
printName('Adam', surname: 'Nowak');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment