Every app stores values and makes decisions. A shop app stores prices and decides whether an item is out of stock. A school app stores marks and decides who passed. In this lesson you learn the Dart tools for exactly that, and you will use them in every app you build.
Variables and types
A variable is a named box that holds a value. Dart has a few basic types you will use constantly:
intfor whole numbers, such as a quantitydoublefor numbers with decimals, such as a price in cedisStringfor text, such as a nameboolfor true or false, such as whether an order is paid
String customer = 'Sumaila';
int plates = 2;
double pricePerPlate = 25.0;
bool paid = false;You can also write var, and Dart works out the type from the value. Use final for a value that will not change after it is set, and const for a value fixed before the program runs.