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 :.
ReadIn 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 :.
ReadSplitting 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 :.
ReadComparing 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).
ReadThis 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.
ReadFor declaring a variable in dart, 'var' keyword is used. This program will show you how to declare a variable in dart with example.
ReadIn 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 :.
ReadIn 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 :.
ReadWhile 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.
ReadIn 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