Flutter & Dart for Beginners: Complete Course [2023 Latest]_ 3.Introduction to dart functions
https://www.udemy.com/course/flutter-latest-course/learn/lecture/31450860#overview
void main(){
getInfo(name = Iris, rollNum = 21);
}
getInfo(String name, int rollNum){
print(name);
print(rollNum);
}
// Iris
21
void main(){
getInfo(name = Iris, rollNum = 21);
}
getInfo({String name, required int rollNum}){
print(name);
print(rollNum);
}
// required된 rollNum이 없는 경우 error
void main(){
getInfo(rollNum = 21);
}
getInfo({String name, required int? rollNum}){
print(name);
print(rollNum);
}
// null 가능
공식문서 functions 파트 너무 어렵.. 패스~