Quantcast
Channel: Stories by Uday Hiwarale on Medium
Viewing all articles
Browse latest Browse all 145

Dart (DartLang) Introduction: Getting started with Dart/Flutter

$
0
0

LIST OF TUTORIALS

Flutter is a framework written in Dart language for building native applications for iOS and Android platforms. Since it is written in Dart, understanding of the basic concepts of Dart language is essential to work with Flutter.

(Background image source: pexels.com)

TL;DR

All the code used in these articles is available in a Github repository.

thatisuday/dart-getting-started-guide

Dart is a programming language developed at Google, which means it is believed to be developed and maintained for years to come. The original intention behind creating Dart was to replace JavaScript in the browser as Dart has its own VM but failed to achieve this goal.

Nevertheless, Dart is a statically typed and object-oriented programming language that can be compiled to machine code or transpiled to JavaScript or can be run as like an interpreted language on the Dart VM using Dart CLI (JIT Compilation). For learning, we will execute Dart code on Dart VM.

Dart is a single-threaded language with an Event loop much like JavaScript in your browser and Node.js. But it supports creating other threads to launch background jobs AKA asynchronous programming. This Medium article also covers most of the internals of asynchronous programming in Dart.

Though there are endless possibilities with Dart, we are going to focus on main language features like Syntax, Data Types, Conditional Statements, Loops, OOP concepts, etc. to get going with Flutter. Even if you don’t know what Flutter is and just want to learn Dart, this article will cover most of the Dart language specifications.

💡 To install Dart CLI, follow download instructions at https://dart.dev/get-dart. Once installed, you should be able to use dart command. Check Dart VM version using dart --version and you are good to go.

This used to be a long article but it was getting difficult to manage and from the reader’s point of view, a huge mess when reading in parts. Hence I decided to split up the article in different segments and create a new publication to manage upcoming Dart articles.

Apology for the inconvenience.

Hello World Program

🎯 Dart (DartLang) Introduction: Hello World Program

Variables and Data Types

🎯 Dart (DartLang) Introduction: Variables and Data Types

String Interpolation

🎯 Dart (DartLang) Introduction: String Interpolation

Arithmetic Operations

🎯 Dart (DartLang) Introduction: Arithmetic Operations

Conditional statements in Dart

Loops in Dart

Functions and Fat Arrow Expression

🎯 Dart (DartLang) Introduction: Functions and Fat Arrow Expression

Exception handling

🎯 Dart (DartLang) Introduction: Exception handling

Object-oriented Programming

🎯 Dart (DartLang) Introduction: Object-oriented Programming

Async programming & Futures

🎯 Dart (DartLang) Introduction: Async programming (Future)

Packages and Libraries in Dart

🎯 Dart (DartLang) Introduction: Packages and Libraries

Dart Source Code

All the code used in these articles is available in a Github repository.

thatisuday/dart-getting-started-guide

All the screenshots of the code examples in this article were taken using catage CLI tool I built with Node.js. Have a look.

Dart supports mean cool features like creating a compile-time constant data structures, spread operators, etc.

  1. Typecasting (type conversion) in Dart
    1. https://stackoverflow.com/a/20859856/2790983
  2. Compile-time constant Lists, Sets, and Maps
    1. https://dart.dev/guides/language/language-tour#lists
  3. Spread operator
    1. https://dart.dev/guides/language/language-tour#lists
  4. JSON support
    1. https://api.dart.dev/stable/2.5.0/dart-convert/JsonCodec-class.html
    2. https://flutter.dev/docs/development/data-and-backend/json
  5. Microtask, Event loop and Isolate
    1. http://jpryan.me/dartbyexample/examples/microtasks/
    2. https://www.didierboelens.com/2019/01/futures---isolates---event-loop/
  6. Mixins in Dart
    1. https://medium.com/flutter-community/dart-what-are-mixins-3a72344011f3
  7. Callable classes
    1. https://www.w3adda.com/dart-tutorial/dart-callable-classes
    2. https://dart.dev/guides/language/language-tour#callable-classes
  8. Publishing packages
    1. https://dart.dev/tools/pub/publishing
    2. Semantic Versioning: https://semver.org/spec/v2.0.0-rc.1.html
    3. https://dart.dev/tools/pub/cmd/pub-uploader
  9. Typedef
    1. https://stackoverflow.com/questions/12545762/what-is-a-typedef-in-dart
    2. https://medium.com/@castellano.mariano/typedef-in-dart-40e96d3941f9
  10. Compilation to Machine Code
    1. https://dart.dev/tutorials/server/get-started#8-compile-for-production

🎯 Dart (DartLang) Introduction: Getting started with Dart/Flutter was originally published in RunDart on Medium, where people are continuing the conversation by highlighting and responding to this story.


Viewing all articles
Browse latest Browse all 145

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>