Show Menu
Cheatography

Cheatsheet_MobileApplication Cheat Sheet (DRAFT) by

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

Get Started

Install Flutter
Install Android Studio
Install Flutter Plugin in Android Studio
File -> Settings -> Plugins -> Flutter
Iphone as Mobile Device
Buy Developer Account or use Emulator
Other Mobile Device
Connect using by USB and enable Developer Mode
Emulator
AVD Manager -> Create Virtual Device
Hot Reload
STRG+S -> App is updated automa­tically

pubspe­c.yaml code

add dependency example
cupert­ino­_icons: ^0.1.2
syntax
depend­encies:                                                flutter:                                                  sdk: flutter                                                cupert­ino­_icons: ^0.1.2                                 +              englis­h_w­ords: ^3.1.5
 

main.dart code

Importing from a package
import 'packa­ge:­flu­tte­r/m­ate­ria­l.d­art';
Run a class (e.g. MyApp())
void main() => runApp­(My­App());
Set title in appbar
appBar: AppBar(           title: Text('­Welcome to Flutter'),         )
Set text in the body
body: Center(           child: Text('­Hello World'),         )
display something in a list
return ListTile(     title: Text(       pair.a­sPa­sca­lCase,       style: _bigge­rFont,     )
random words class
class Random­Wor­dsState extends State<­Ran­dom­Wor­ds> {   @override   Widget build(­Bui­ldC­ontext context) {     final wordPair = WordPa­ir.r­an­dom();     return Text(w­ord­Pai­r.a­sPa­sca­lCase);   } }
set AppBar
return Scaffold(     appBar: AppBar(       title: Text('­Startup Name Genera­tor'),     ),     body: _build­Sug­ges­tio­ns(),   );