dart

dart

Dart list : Explanation with example

List or array of similar items is used in all programming languages.In dart, this is represented by array or commonly known as lists. List is an ordered group of objects. The index of the list starts from 0.So, the index of the first element is 0,second element is 1 etc. Using this index,we can access any value for a specific position in the list.Creating a simple looks like as below :.

Read
dart

Dart example program to iterate through a list

In this tutorial, we will learn how to iterate through a list of items in dart. List holds items of similar type. The sample program we are going to check here will first create one list of integers, then it will add few integers to the list and finally it will iterate through the list and print out the values. Let's take a look :.

Read
dart

How to split a string in Dart

Splitting a string is available in almost all programming languages. Splitting divides a string in different parts based on one expression or rule. In dart also, we have an inbuilt splitting method known as split(). We can define it as below :.

Read
dart

Dart comparable example for comparing objects

Comparing two custom object can be done using Comparable interface. If you are familiar with Java, it works in a similar manner. In this tutorial, I will show you two examples of how to use it in Dart.Suppose, we have a list of students and we want to compare two students based on their marks. Our program will compare any two of the students and print out the result (which one got the highest mark).

Read
dart

How to convert a string to DateTime and DateTime to ISO8601 in Dart

This dart tutorial will show you how to convert one string to DateTime and DateTime to ISO8601 string. Dart DateTime module provides one inbuilt method to do the conversion easily.

Read
dart

Dart 2 tutorial : Variables in dart with example

For declaring a variable in dart, 'var' keyword is used. This program will show you how to declare a variable in dart with example.

Read
dart

Convert all characters of a string to uppercase or lowercase in dart

In this dart programming tutorial, we will learn how to convert all characters of a string to uppercase or lowercase. To convert all characters of a string to uppercase or lowercase, dart provides two different methods. Let's take a look at these methods first :.

Read
dart

Dart tutorial : string (explanation with examples)

In dart, a string is a sequence of UTF-16 code units. To create one string variable, we can use either single quote or double quote like below :.

Read
dart

Dart number datatype : integers and double

While creating variables, we need to define its type. For example, if it is string variable or a numerical variable. Dart also provides different datatypes. We will learn about each datatype one by one. This tutorial will explain you about Number datatype in Dart.The first thing that comes to our mind is integers if we talk about numbers. In dart, we have two types of number variables- integers and doubles.

Read
dart

Compare two numbers using compareTo method in Dart

In this dart tutorial, we will learn how to compare two numbers using compareTo methods. We know that numbers in dart can be categorized into two types- integer and doubles. Dart has one inbuilt method compareTo to compare two different integer or double variables. We can define this method as below :.

Read