diff --git a/src/content/learn/pathway/tutorial/listenable-builder.md b/src/content/learn/pathway/tutorial/listenable-builder.md index 8da714f918..1ed2b69ba1 100644 --- a/src/content/learn/pathway/tutorial/listenable-builder.md +++ b/src/content/learn/pathway/tutorial/listenable-builder.md @@ -80,6 +80,29 @@ class ArticleView extends StatelessWidget { } ``` +### Update your app to include the article view + +Connect everything together by updating your `MainApp` to +include your completed `ArticleView`. + +Replace your existing `MainApp` with this updated version: + +```dart +class MainApp extends StatelessWidget { + const MainApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: ArticleView(), + ); + } +} +``` + +This change switches from the console-based test to the full UI +experience with proper state management. + ### Listen for state changes Wrap your UI in a [`ListenableBuilder`][] to listen for state changes, @@ -399,29 +422,6 @@ This widget demonstrates a few important UI concepts: - **Overflow handling**: `TextOverflow.ellipsis` prevents text from breaking the layout. -### Update your app to include the article view - -Connect everything together by updating your `MainApp` to -include your completed `ArticleView`. - -Replace your existing `MainApp` with this updated version: - -```dart -class MainApp extends StatelessWidget { - const MainApp({super.key}); - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: ArticleView(), - ); - } -} -``` - -This change switches from the console-based test to the full UI -experience with proper state management. - ### Run the complete app Hot reload your app one final time. You should now see: