diff --git a/src/content/learn/pathway/tutorial/listenable-builder.md b/src/content/learn/pathway/tutorial/listenable-builder.md index 11982484ca..ece286b1ff 100644 --- a/src/content/learn/pathway/tutorial/listenable-builder.md +++ b/src/content/learn/pathway/tutorial/listenable-builder.md @@ -60,12 +60,12 @@ class ArticleView extends StatelessWidget { } ``` -### Create the article view model +### Instantiate the article view model -Create the `ArticleViewModel` in this widget: +Instantiate the `ArticleViewModel` in a `viewModel` field in the widget: -```dart +```dart highlightLines=4 class ArticleView extends StatelessWidget { ArticleView({super.key}); @@ -89,7 +89,7 @@ include your completed `ArticleView`. Replace your existing `MainApp` with this updated version: -```dart +```dart highlightLines=6 class MainApp extends StatelessWidget { const MainApp({super.key}); @@ -110,7 +110,7 @@ and pass it a `ChangeNotifier` object. In this case, the `ArticleViewModel` extends `ChangeNotifier`. -```dart +```dart highlightLines=10-15 class ArticleView extends StatelessWidget { ArticleView({super.key}); @@ -155,7 +155,7 @@ Use Dart's support for [switch expressions][] to handle all possible combinations in a clean, readable way: -```dart +```dart highlightLines=14-27 class ArticleView extends StatelessWidget { ArticleView({super.key}); @@ -235,7 +235,7 @@ class ArticlePage extends StatelessWidget { Replace the placeholder with a scrollable column layout: -```dart +```dart highlightLines=13-16 class ArticlePage extends StatelessWidget { const ArticlePage({ super.key, @@ -262,7 +262,7 @@ class ArticlePage extends StatelessWidget { Complete the layout with an article widget and navigation button: -```dart +```dart highlightLines=16-20 class ArticlePage extends StatelessWidget { const ArticlePage({ super.key, @@ -318,7 +318,7 @@ class ArticleWidget extends StatelessWidget { Wrap the content in proper padding and layout: -```dart +```dart highlightLines=8-14 class ArticleWidget extends StatelessWidget { const ArticleWidget({super.key, required this.summary}); @@ -342,7 +342,7 @@ class ArticleWidget extends StatelessWidget { Add the article image that only shows when available: -```dart +```dart highlightLines=13 class ArticleWidget extends StatelessWidget { const ArticleWidget({super.key, required this.summary}); @@ -370,7 +370,7 @@ Replace the placeholder text with a properly styled title, description, and extract: -```dart +```dart highlightLines=14-25 class ArticleWidget extends StatelessWidget { const ArticleWidget({super.key, required this.summary});