Last active
April 12, 2019 00:28
-
-
Save Sfshaza/d7f13ddd8888556232476be8578efe40 to your computer and use it in GitHub Desktop.
Step 3 - Flutter's Getting Started Codelab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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