@@ -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
6969class ArticleView extends StatelessWidget {
7070 ArticleView({super.key});
7171
@@ -89,7 +89,7 @@ include your completed `ArticleView`.
8989Replace 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
9393class MainApp extends StatelessWidget {
9494 const MainApp({super.key});
9595
@@ -110,7 +110,7 @@ and pass it a `ChangeNotifier` object.
110110In 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
114114class ArticleView extends StatelessWidget {
115115 ArticleView({super.key});
116116
@@ -155,7 +155,7 @@ Use Dart's support for [switch expressions][]
155155to 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
159159class ArticleView extends StatelessWidget {
160160 ArticleView({super.key});
161161
@@ -235,7 +235,7 @@ class ArticlePage extends StatelessWidget {
235235Replace 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
239239class ArticlePage extends StatelessWidget {
240240 const ArticlePage({
241241 super.key,
@@ -262,7 +262,7 @@ class ArticlePage extends StatelessWidget {
262262Complete 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
266266class ArticlePage extends StatelessWidget {
267267 const ArticlePage({
268268 super.key,
@@ -318,7 +318,7 @@ class ArticleWidget extends StatelessWidget {
318318Wrap 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
322322class ArticleWidget extends StatelessWidget {
323323 const ArticleWidget({super.key, required this.summary});
324324
@@ -342,7 +342,7 @@ class ArticleWidget extends StatelessWidget {
342342Add 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
346346class ArticleWidget extends StatelessWidget {
347347 const ArticleWidget({super.key, required this.summary});
348348
@@ -370,7 +370,7 @@ Replace the placeholder text with a
370370properly styled title, description, and extract:
371371
372372<? code-excerpt "fwe/wikipedia_reader/lib/step4_main.dart (article)"?>
373- ``` dart
373+ ``` dart highlightLines=14-25
374374class ArticleWidget extends StatelessWidget {
375375 const ArticleWidget({super.key, required this.summary});
376376
0 commit comments