vijaycreations
Published in

vijaycreations

Parameter Passing Types — Dart

The two most basic kinds of argument are Positional Arguments and Named Arguments In this article we shall be discussing about the basic difference between these two argument types and the scenario of where to apply them.

Video Tutorial

Implementation

Positional Arguments:

  1. In Case of Positional Arguments the order in which the data is being passed must not be changed [In our case (from below image) the first argument is of type String and the next argument is of type Double so in the function-call also we need to follow this order, String followed by Double].
  2. And the next rule is, all arguments are required by default. [As we have defined String and Double in our function, both the values need to be passed during the function-call. No argument is optional unless specified].

Named Arguments:

Note: Differ by curly bracket in the Function Definition.

  1. In Case of Named Arguments the order in which the data is being passed can be changed.
  2. And all the arguments are optional by default.(i.e., we can either pass the argument value or leave it empty unless it takes a null value).

👨‍💻Get the complete Source Code here 👉🏻: https://github.com/vijayinyoutube/dartarguments

--

--

A list of Flutter Tutorials and app templates

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vijay R

Hai👋 I’m a flutter developer experienced in designing and developing stunning mobile apps. Reach out for freelance projects: vijaycreations02@gmail.com