Explorer
Content
videos
cheat-sheet.md
flutter cheat-sheet.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Flutter Terminal Cheat Sheet

Run Flutter web with SKIA
-------------------------

```markdown
flutter run -d web --release --dart-define=FLUTTER_WEB_USE_SKIA=true
```

Run Flutter web with Canvas Kit
-------------------------------

```markdown
flutter run -d chrome --release --dart-define=FLUTTER_WEB_USE_EXPERIMENTAL_CANVAS_TEXT=true
```

Build your Flutter web app to Github Pages to the docs folder
-------------------------------------------------------------

```markdown
flutter build web && rm -rf ./docs && mkdir ./docs && cp -a ./build/web/. ./docs/
```

Clean rebuild CocoaPods
-----------------------

```markdown
cd ios && pod deintegrate && pod cache clean —all && pod install && cd ..
```

> Sometimes with firebase you need to run: `pod update Firebase`

Create Dart package with Example
--------------------------------

```markdown
flutter create -t plugin . && flutter create -i swift -a kotlin --androidx example
```

Watch Build Files
-----------------

```markdown
flutter packages pub run build_runner watch  -—delete-conflicting-outputs
```

Generate Build Files
--------------------

```markdown
flutter packages pub run build_runner build  -—delete-conflicting-outputs
```

Build Bug Report
----------------

```markdown
flutter run —bug-report
```

Flutter generate test coverage
------------------------------

```markdown
flutter test --coverage && genhtml -o coverage coverage/lcov.info
```

Rebuild Flutter Cache
---------------------

```markdown
flutter pub pub cache repair
```

Clean every flutter project
---------------------------

```markdown
find . -name "pubspec.yaml" -exec $SHELL -c '
    echo "Done. Cleaning all projects."
    for i in "$@" ; do
        DIR=$(dirname "${i}")
        echo "Cleaning ${DIR}..."
        (cd "$DIR" && flutter clean >/dev/null 2>&1)
    done
    echo "DONE!"
' {} +
```

Conditional Export/Import
-------------------------

```dart
export 'unsupported.dart'
    if (dart.library.html) 'web.dart'
    if (dart.library.io) 'mobile.dart';
```

Kill Dart Running
-----------------

```markdown
killall -9 dart
```

Flutter scripts 
----------------

Add all the scripts to your `pubspec.yaml` with [flutter\_scripts](https://pub.dev/packages/flutter_scripts).