A Beginners Guide to Dart - Types, Functions, Variables and Objects - Part One
Repository
https://github.com/dart-lang/sdk
What Will I Learn?
- You will learn about the Basics of programming
- You will learn about Objects in Dart
- You will learn about Types in Dart
- You will learn about how Functions are Objects in Dart
- You will learn how to use closures and first class functions
- You will learn how to bind variables in Dart
Requirements
System Requirements:
- IDEA intellij or Visual Studio Code with the Dart Plugins
- The Dart SDK
OS Support for Dart:
- Windows
- macOS
- Linux
Required Knowledge
- The Dart SDK
- A dart supported text editor
- A little time to sit and watch a video and some patience to learn the language
Resources for Dart:
- Dart Website: https://www.dartlang.org/
- Dart Official Documentation: https://www.dartlang.org/guides/language/language-tour
- Dart GitHub repository: https://github.com/dart-lang/sdk
- Awesome Dart GitHub Repository: https://github.com/yissachar/awesome-dart
- Pub website: https://pub.dartlang.org
Sources:
Dart Logo (Google): https://www.dartlang.org/
Difficulty
- Beginner
Description
With Dart's roots in JavaScript, Java, C#, Smalltalk and Erlang; there are very few resources that teach Dart to non-programmers. As a result, it is difficult to get into Dart and subsequently the Flutter Framework, without knowing another programming language first. This runs counter to the notion that Flutter and Dart are easy to learn and be productive in. These video tutorials aim to rectify this shortage of information and provide a deep dive look into the Dart programming language.
Types in the Dart Programming Language
Dart is general purpose programming language that was originally designed by Google for client side development. The language is both Imperative and Object Oriented with some small functional features scattered throughout. With an Imperative language, a developer defines sequential instructions that build a program. This is further abstracted upon with the Object system in Dart. Every Type that can be assigned to a variable is an Object in Dart.
Dart contains seven main primitive types in its static type system: numbers, strings, booleans, lists, maps, runes and symbols. Numbers include Floats and Integers. Strings are used to represent text by using single and double quotations. Booleans are binary values that can either be True or False. Lists are zero indexable collections of data. Maps are collections with associative key-value pairs. Runes are UTF-32 code points which are used to create strings and characters. Symbols are symbolic names used for mirrors, invocations, and functions.
First Class Functions and Closures
A side effect of most types being Objects is that functions are also Objects in Dart. Functions are first class citizens in Dart because they also support all operations that are available to Objects. They can be assigned to a variable, passed as an argument to another function, returned from a function, stored in other Data collections, and created in any scope. Functions can have static type signatures and they can have dynamic type signatures. Functions can also be anonymous or in other terms, closures.
In the above image, there are examples of the traits mentioned above. Two functions add
and sub
are defined using single line notation. The choose
function returns either add
or sub
depending on the boolean argument that is passed into it. The exec
function takes in a function as an argument and that function can be any function that takes in two arguments. The operator
list contains both the add
and sub
functions inside of it.
The Source Code for this video may be found here: https://github.com/tensor-programming/dart_for_beginners
I thank you for your contribution. Here are my thoughts. Note that, my thoughts are my personal ideas on your post and they are not directly related to the review and scoring unlike the answers I gave in the questionnaire;
Structure
Content
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Chat with us on Discord.
[utopian-moderator]
Thanks for the feedback and thanks for moderating my contribution.
Thank you for your review, @yokunjon! Keep up the good work!
This post has been voted on by the SteemSTEM curation team and voting trail in collaboration with @curie.
If you appreciate the work we are doing then consider voting both projects for witness by selecting stem.witness and curie!
For additional information please join us on the SteemSTEM discord and to get to know the rest of the community!
Congratulations @tensor! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word
STOP
Hi, @tensor!
You just got a 5.18% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.
Hi @tensor!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server
Hey, @tensor!
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!