Skip to content

Commit 7c873e7

Browse files
authored
Highlight relevant lines per step in listenable-builder lesson (#13291)
Fixes #13119 by more clearly separating the steps and the relevant content in each
1 parent 478f8cb commit 7c873e7

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

src/content/learn/pathway/tutorial/listenable-builder.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ class ArticleView extends StatelessWidget {
6060
}
6161
```
6262

63-
### Create the article view model
63+
### Instantiate the article view model
6464

65-
Create the `ArticleViewModel` in this widget:
65+
Instantiate the `ArticleViewModel` in a `viewModel` field in the widget:
6666

6767
<?code-excerpt "fwe/wikipedia_reader/lib/step4b_main.dart (view-model)"?>
68-
```dart
68+
```dart highlightLines=4
6969
class ArticleView extends StatelessWidget {
7070
ArticleView({super.key});
7171
@@ -89,7 +89,7 @@ include your completed `ArticleView`.
8989
Replace your existing `MainApp` with this updated version:
9090

9191
<?code-excerpt "fwe/wikipedia_reader/lib/step4_main.dart (main-app)"?>
92-
```dart
92+
```dart highlightLines=6
9393
class MainApp extends StatelessWidget {
9494
const MainApp({super.key});
9595
@@ -110,7 +110,7 @@ and pass it a `ChangeNotifier` object.
110110
In this case, the `ArticleViewModel` extends `ChangeNotifier`.
111111

112112
<?code-excerpt "fwe/wikipedia_reader/lib/step4c_main.dart (view-model)"?>
113-
```dart
113+
```dart highlightLines=10-15
114114
class ArticleView extends StatelessWidget {
115115
ArticleView({super.key});
116116
@@ -155,7 +155,7 @@ Use Dart's support for [switch expressions][]
155155
to handle all possible combinations in a clean, readable way:
156156

157157
<?code-excerpt "fwe/wikipedia_reader/lib/step4_main.dart (view-model)"?>
158-
```dart
158+
```dart highlightLines=14-27
159159
class ArticleView extends StatelessWidget {
160160
ArticleView({super.key});
161161
@@ -235,7 +235,7 @@ class ArticlePage extends StatelessWidget {
235235
Replace the placeholder with a scrollable column layout:
236236

237237
<?code-excerpt "fwe/wikipedia_reader/lib/step4e_main.dart (page)"?>
238-
```dart
238+
```dart highlightLines=13-16
239239
class ArticlePage extends StatelessWidget {
240240
const ArticlePage({
241241
super.key,
@@ -262,7 +262,7 @@ class ArticlePage extends StatelessWidget {
262262
Complete the layout with an article widget and navigation button:
263263

264264
<?code-excerpt "fwe/wikipedia_reader/lib/step4_main.dart (page)"?>
265-
```dart
265+
```dart highlightLines=16-20
266266
class ArticlePage extends StatelessWidget {
267267
const ArticlePage({
268268
super.key,
@@ -318,7 +318,7 @@ class ArticleWidget extends StatelessWidget {
318318
Wrap the content in proper padding and layout:
319319

320320
<?code-excerpt "fwe/wikipedia_reader/lib/step4g_main.dart (article)"?>
321-
```dart
321+
```dart highlightLines=8-14
322322
class ArticleWidget extends StatelessWidget {
323323
const ArticleWidget({super.key, required this.summary});
324324
@@ -342,7 +342,7 @@ class ArticleWidget extends StatelessWidget {
342342
Add the article image that only shows when available:
343343

344344
<?code-excerpt "fwe/wikipedia_reader/lib/step4h_main.dart (article)"?>
345-
```dart
345+
```dart highlightLines=13
346346
class ArticleWidget extends StatelessWidget {
347347
const ArticleWidget({super.key, required this.summary});
348348
@@ -370,7 +370,7 @@ Replace the placeholder text with a
370370
properly styled title, description, and extract:
371371

372372
<?code-excerpt "fwe/wikipedia_reader/lib/step4_main.dart (article)"?>
373-
```dart
373+
```dart highlightLines=14-25
374374
class ArticleWidget extends StatelessWidget {
375375
const ArticleWidget({super.key, required this.summary});
376376

0 commit comments

Comments
 (0)