Cheatography
https://cheatography.com
MobileApplication1 Cheatsheet
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 |
What is Flutter?
open source mobile application developement SDK |
cross platform app development |
code one time for both IOS and Android apps |
pubspec code
add dependency example |
cupertino_icons: ^0.1.2 |
|
|
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.asPa‐ scalCase, style: _biggerFont, )
|
random words class class RandomWordsState extends State<‐ RandomWords> { @override Widget build(‐ BuildContext context) { final wordPair = WordPair.random(); return Text(wordPai‐ r.asPascalCase); } }
|
set AppBar return Scaffold( appBar: AppBar( title: Text('Startup Name Generator'), ), body: _buildSuggestions(), );
|
|