parent
2c2ef644a7
commit
556c94f979
|
@ -13,17 +13,31 @@ class MyApp extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final wordPair = WordPair.random();
|
||||
return MaterialApp(
|
||||
title: 'Welcome to Flutter',
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Welcome to Flutter'),
|
||||
),
|
||||
body: Center(
|
||||
child: Text(wordPair.asPascalCase),
|
||||
body: const Center(
|
||||
child: RandomWords(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class RandomWords extends StatefulWidget {
|
||||
const RandomWords({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<RandomWords> createState() => _RandomWordsState();
|
||||
}
|
||||
|
||||
class _RandomWordsState extends State<RandomWords> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final wordPair = WordPair.random();
|
||||
return Text(wordPair.asPascalCase);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue