Named parameters

Named parameters are optional unless they’re specifically marked as required.
A parameter wrapped by { } is a named optional parameter. Here is an example:

void main() {

  void login({username, password}) {

    //statements

  }

  login(username: "flutterStudent", password: "california1989");

}



When calling login function, you can specify named parameters using paramName: value.