Show Menu
Cheatography

flutter Cheat Sheet (DRAFT) by

flutter cheat sheet for nvs

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 applic­ations for mobile, web, and desktop from a single codebase.
What progra­mming 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);
}