@@ -221,7 +221,7 @@ steps:
221
221
import 'package:flutter_test/flutter_test.dart';
222
222
223
223
import 'package:namer_app/main.dart';
224
- @@ -7,4 +8,44 @@ void main() {
224
+ @@ -7,4 +8,43 @@ void main() {
225
225
await tester.pumpWidget(const MyApp());
226
226
expect(find.text('A random AWESOME idea:'), findsOneWidget);
227
227
});
@@ -230,14 +230,13 @@ steps:
230
230
+ await tester.pumpWidget(const MyApp());
231
231
+
232
232
+ String findWordPair() {
233
- + final wordPairTextWidget =
234
- + tester
235
- + // Get all Text widgets...
236
- + .widgetList<Text>(find.byType(Text))
237
- + // ... skip one ('A random AWESOME idea:') ...
238
- + .skip(1)
239
- + // ... and take the first after it.
240
- + .first;
233
+ + final wordPairTextWidget = tester
234
+ + // Get all Text widgets...
235
+ + .widgetList<Text>(find.byType(Text))
236
+ + // ... skip one ('A random AWESOME idea:') ...
237
+ + .skip(1)
238
+ + // ... and take the first after it.
239
+ + .first;
241
240
+ return wordPairTextWidget.data!;
242
241
+ }
243
242
+
@@ -336,18 +335,17 @@ steps:
336
335
patch-u : |
337
336
--- b/namer/step_05_b_extract/test/widget_test.dart
338
337
+++ a/namer/step_05_b_extract/test/widget_test.dart
339
- @@ -13,14 +13,9 @@ void main() {
338
+ @@ -13,13 +13,9 @@ void main() {
340
339
await tester.pumpWidget(const MyApp());
341
340
342
341
String findWordPair() {
343
- - final wordPairTextWidget =
344
- - tester
345
- - // Get all Text widgets...
346
- - .widgetList<Text>(find.byType(Text))
347
- - // ... skip one ('A random AWESOME idea:') ...
348
- - .skip(1)
349
- - // ... and take the first after it.
350
- - .first;
342
+ - final wordPairTextWidget = tester
343
+ - // Get all Text widgets...
344
+ - .widgetList<Text>(find.byType(Text))
345
+ - // ... skip one ('A random AWESOME idea:') ...
346
+ - .skip(1)
347
+ - // ... and take the first after it.
348
+ - .first;
351
349
+ final wordPairTextWidget = tester.widget<Text>(
352
350
+ find.descendant(of: find.byType(BigCard), matching: find.byType(Text)),
353
351
+ );
0 commit comments