This is a draft cheat sheet. It is a work in progress and is not finished yet.
Flutter
What is Flutter? |
Flutter is Googles toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. |
What programming language is Flutter based on? |
Dart |
When was Flutter released? |
December 2018 |
What well-known apps were created using Flutter? |
Alibaba, New York Times, Tencent, Ebay, BMW, ... |
Hello World in Flutter
import 'package:flutter/material.dart';
void main() => runApp(HelloWorldApp());
class HelloWorldApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Hello World App',
home: Scaffold(
appBar: AppBar(
title: Text('App Bar Title here'),
),
body: Center(
child: Text('Hello World'),
),
),
);
}
}
|
|
|
Create Widget
class RandomWords extends StatefulWidget {
@override
RandomWordsState createState() => RandomWordsState();
}
|
Add Something to a Widget
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Startup Name Generator'),
),
body: _buildSuggestions(),
);
}
|
Change appearance of a Widget
class RandomWordsState extends State<RandomWords> {
final _suggestions = <WordPair>[];
final _biggerFont = const TextStyle(fontSize: 18.0);
}
|
|