Show Menu
Cheatography

Dart Cheat Sheet (DRAFT) by

Dart programming language

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Variables

Create
var name = '...'
Rewrite
name = '...'
+ or -
num ++|--|­**|// 1
Double -> Int
(num/3­).t­oInt(); or num ~/ 3
if num-num=1 T or F
bool num-num == 1
list:
Var list = ['...', '...'];
Create list
list.a­dd(­"­nam­e");
add name to list
list.r­emo­ve(­"­nam­e");
remove name from list
list.r­emo­veAt(4)
remove element with index 4
name = list[50]
get element with index 50
list[50] = "­nam­e"
rewrite index 50 with name
list.a­ddA­ll(­['...', '...', '...'])
add all to list
list.c­ont­ain­s('...')
is ... in list?
list.c­lear()
clear list
list.l­ength
how long is list
list.i­nde­xOf­('...')
index of element ... is

Var types

String
Text
Int
Number
Bool
True/False
Double
Number with .
Final
creating while compil­ation
Static
creating while writing code
dynamic
anything
 

Dart

dart create -t web-simple name
create dart web project
dart compile js path/t­o/dart -o path/to/js
compile dart to js
 

Comands

DateTi­me.n­ow()
Time now