diff --git a/lib/main.dart b/lib/main.dart index e59b547..4d40240 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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(), ), ), ); } -} \ No newline at end of file +} + +class RandomWords extends StatefulWidget { + const RandomWords({Key? key}) : super(key: key); + + @override + State createState() => _RandomWordsState(); +} + +class _RandomWordsState extends State { + @override + Widget build(BuildContext context) { + final wordPair = WordPair.random(); + return Text(wordPair.asPascalCase); + } +}