Skip to content

Instantly share code, notes, and snippets.

@Sfshaza
Last active April 12, 2019 00:28
Show Gist options
  • Save Sfshaza/d7f13ddd8888556232476be8578efe40 to your computer and use it in GitHub Desktop.
Save Sfshaza/d7f13ddd8888556232476be8578efe40 to your computer and use it in GitHub Desktop.
Step 3 - Flutter's Getting Started Codelab
// Add a stateful widget
import 'package:flutter/material.dart';
import 'package:english_words/english_words.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Welcome to Flutter',
home: new Scaffold(
appBar: new AppBar(
title: const Text('Welcome to Flutter'),
),
body: new Center(
child: new RandomWords(),
),
),
);
}
}
class RandomWords extends StatefulWidget {
@override
RandomWordsState createState() => new RandomWordsState();
}
class RandomWordsState extends State<RandomWords> {
@override
Widget build(BuildContext context) {
final WordPair wordPair = new WordPair.random();
return new Text(wordPair.asPascalCase);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment