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 automatically |
pubspec.yaml code
add dependency example |
cupertino_icons: ^0.1.2 |
syntax |
dependencies: flutter: sdk: flutter cupertino_icons: ^0.1.2 + english_words: ^3.1.5
|
|
|
main.dart code
Importing from a package |
import 'package:flutter/material.dart';
|
Run a class (e.g. MyApp()) |
void main() => runApp(MyApp());
|
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.asPascalCase, style: _biggerFont, )
|
random words class |
class RandomWordsState extends State<RandomWords> { @override Widget build(BuildContext context) { final wordPair = WordPair.random(); return Text(wordPair.asPascalCase); } }
|
set AppBar |
return Scaffold( appBar: AppBar( title: Text('Startup Name Generator'), ), body: _buildSuggestions(), );
|
|