Functions in Dart
Tags: dart, todayilearned, beginners, code
Published: 2019-09-15 23:12:08

* A function is a group of statements that perform a specific task.

* Functions are mostly used to automate the repeated task. They are basically used to divide the large program into smaller chunks.
    
* Divide our program into smaller chunks makes it more organized and manageable. Also, it avoids repetition and makes our code reusable.

* The bad thing about function is they are famous with several names. Different programming languages name them differently. For example functions, methods, sub-routines, procedures, etc. When you hear any one of them just imagine about the same concept.

###Advantages of Functions
***


Functions have three major advantages:

1. They make our code manageable.
2. They reduce the boilerplate code
3. They make our code reusable.

##Types of Functions
***

There are basically two types of functions in programming.

1. Built-in functions
2. User-define functions

###Built-in functions

* Built-in functions are functions that is comes with language and they are ready to use. For example in dart print(), readLineSync(), tryParse() are built-in functions.

* In dart, there are many libraries, in which all built-in functions are stored and ready to help you. Dart SDK comes with many pre-built libraries like a dart: core, dart: async, dart: collection, etc.

**Dart libraries come in three major flavors:**

* **Core libraries —** Core libraries come directly with the Dart SDK. You can find detail documentation on [Dart API](https://api.dartlang.org/stable/2.1.1/index.html).

* **Community Shared Libraries —** Some libraries are shared with the Dart community and they are distributed as library packages and published at [Pub Site](https://pub.dev/). The [pub](https://dart.dev/tools/pub/cmd) tool allows us to create, publish and manage library packages.
    
* You can also use libraries from GitHub, from a URL, or from a local path. Please visit [this](https://dart.dev/tools/pub/dependencies#dependency-sources) for more information.

###User define functions


* User-define functions are functions that are created by programmers. You can also create functions according to your needs and that functions will be called User-define functions.

That’s it for function’s introduction guys. I’ll post more articles on functions soon. So please check them as well. Feel free to share with me if I miss something I will love to learn it from you.

Remember no teacher, no book, no video tutorial, or no blog can teach you everything. As one said Learning is Journey and Journey never ends. Just collect some data from here and there, read it, learn it, practice it, and try to apply it. Don’t feel hesitate that you can’t do that or you don’t know this concept or that concept. Remember every programmer was passed from the path on which you are walking right now. Remember Every Master was Once a Beginner. Work hard and Give your best.

Till Then Keep Loving, Keep Coding. And just like always I’ll surely catch you up in the next article.

##For more information please visit
***

* [Package dependencies](https://dart.dev/tools/pub/dependencies#dependency-sources)

* [pub Tool](https://dart.dev/tools/pub/cmd)

* [Dart API docs](https://api.dartlang.org/stable/2.1.1/index.html)

* [Dart Packages](https://pub.dev/)
* [Fuchsia OS official site](https://fuchsia.dev/)
* [Dart official site](https://dart.dev/)
* [Flutter official site](https://flutter.dev/)

Jai Hind, Vande Mataram 🇮🇳

Wanna get in touch with me? Here are links. I’ll love to become your friend. 😊

- [My Site] (https://www.jaytillu.in)
- [My Blogs] (https://blogs.jaytillu.in)
- [Twitter](https://twitter.com/jay_tillu)
- [Facebook](https://www.facebook.com/jaytillu.1314/)
- [Instagram](https://www.facebook.com/jaytillu.1314/)
- [Medium](https://medium.com/jay-tillu)
- [LinkedIn](https://www.linkedin.com/in/jaytillu/)
- [Github](https://www.github.com/jay-tillu)
- [Stack overflow](https://stackoverflow.com/users/8509590/jay-tillu)
or just mail me at jd.tillu@gmail.com