parent
2c2ef644a7
commit
556c94f979
|
@ -13,17 +13,31 @@ class MyApp extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final wordPair = WordPair.random();
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
title: 'Welcome to Flutter',
|
title: 'Welcome to Flutter',
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Welcome to Flutter'),
|
title: const Text('Welcome to Flutter'),
|
||||||
),
|
),
|
||||||
body: Center(
|
body: const Center(
|
||||||
child: Text(wordPair.asPascalCase),
|
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