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).toInt(); or num ~/ 3 |
if num-num=1 T or F |
bool num-num == 1 |
list: |
Var list = ['...', '...']; |
Create list |
list.add("name"); |
add name to list |
list.remove("name"); |
remove name from list |
list.removeAt(4) |
remove element with index 4 |
name = list[50] |
get element with index 50 |
list[50] = "name" |
rewrite index 50 with name |
list.addAll(['...', '...', '...']) |
add all to list |
list.contains('...') |
is ... in list? |
list.clear() |
clear list |
list.length |
how long is list |
list.indexOf('...') |
index of element ... is |
Var types
String |
Text |
Int |
Number |
Bool |
True/False |
Double |
Number with . |
Final |
creating while compilation |
Static |
creating while writing code |
dynamic |
anything |
|
|
Dart
dart create -t web-simple name |
create dart web project |
dart compile js path/to/dart -o path/to/js |
compile dart to js |
|
|
Comands
DateTime.now() |
Time now |
|