Learn all basic about dart programming language
- Dart is an object-oriented programming(OOP) language, that has a class-based style.
- Flutter is build with dart and everything we code is Flutter is also dart.
Learn Dart Programming language
Commenting Code
- Single line comments
//example of single line comments
- Multi-line comments
/*
example of
multiline comments
*/
Running The main() entry point
- Every app must have a top level main() function, which is entry point of the app.
Syntax And Example:
Declaring Variables in Dart
- Here are the ways to declare variables in dart
Public vs Private Variable
- All variables are by default public.
- Starting variable with _(underscore), the variable becomes private which means it cannot be accessed from outside class/function.
Syntax:
Numbers in dart
- There are two numeric types:
int
, representing integer values, anddouble
, representing fractional values.
Strings
Boolean
- The Boolean data type is used to declare a variable whose value will be set as true (1) or false (0). To declare such a value, you use the bool keyword.
Lists
- It is comparable to arrays
Maps
- Maps are invaluable in associating a List of values by a key and a value.
- Here, key must be unique
Runes (Emojis)
- Runes are the UTF-32 code points of string like Emojis.
Using Operators
- Arithmetic Operators
- Equality and relational operators
- Type test operators
- Assignment Operator