Skip to content

Commit e9c94e6

Browse files
author
Jonah Williams
authored
fix build analysis errors (flutter#67476)
1 parent f1c1d94 commit e9c94e6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

packages/flutter/test/cupertino/segmented_control_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void main() {
256256
DefaultTextStyle textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1'));
257257
IconTheme iconTheme = tester.widget(find.widgetWithIcon(IconTheme, const IconData(1)));
258258

259-
expect(textStyle.style!.color, isSameColorAs(CupertinoColors.white));
259+
expect(textStyle.style.color, isSameColorAs(CupertinoColors.white));
260260
expect(iconTheme.data.color, CupertinoColors.activeBlue);
261261

262262
await tester.tap(find.widgetWithIcon(IconTheme, const IconData(1)));
@@ -265,7 +265,7 @@ void main() {
265265
textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1'));
266266
iconTheme = tester.widget(find.widgetWithIcon(IconTheme, const IconData(1)));
267267

268-
expect(textStyle.style!.color, CupertinoColors.activeBlue);
268+
expect(textStyle.style.color, CupertinoColors.activeBlue);
269269
expect(iconTheme.data.color, isSameColorAs(CupertinoColors.white));
270270
});
271271

@@ -300,7 +300,7 @@ void main() {
300300
DefaultTextStyle textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first);
301301
IconThemeData iconTheme = IconTheme.of(tester.element(find.byIcon(const IconData(1))));
302302

303-
expect(textStyle.style!.color, isSameColorAs(CupertinoColors.black));
303+
expect(textStyle.style.color, isSameColorAs(CupertinoColors.black));
304304
expect(iconTheme.color, isSameColorAs(CupertinoColors.systemBlue.darkColor));
305305

306306
await tester.tap(find.byIcon(const IconData(1)));
@@ -310,7 +310,7 @@ void main() {
310310
textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first);
311311
iconTheme = IconTheme.of(tester.element(find.byIcon(const IconData(1))));
312312

313-
expect(textStyle.style!.color, isSameColorAs(CupertinoColors.systemBlue.darkColor));
313+
expect(textStyle.style.color, isSameColorAs(CupertinoColors.systemBlue.darkColor));
314314
expect(iconTheme.color, isSameColorAs(CupertinoColors.black));
315315
},
316316
);
@@ -348,7 +348,7 @@ void main() {
348348
IconTheme iconTheme = tester.widget(find.widgetWithIcon(IconTheme, const IconData(1)));
349349

350350
expect(getRenderSegmentedControl(tester).borderColor, CupertinoColors.black);
351-
expect(textStyle.style!.color, CupertinoColors.lightBackgroundGray);
351+
expect(textStyle.style.color, CupertinoColors.lightBackgroundGray);
352352
expect(iconTheme.data.color, CupertinoColors.activeGreen.color);
353353
expect(getBackgroundColor(tester, 0), CupertinoColors.activeGreen.color);
354354
expect(getBackgroundColor(tester, 1), CupertinoColors.lightBackgroundGray);
@@ -359,7 +359,7 @@ void main() {
359359
textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1'));
360360
iconTheme = tester.widget(find.widgetWithIcon(IconTheme, const IconData(1)));
361361

362-
expect(textStyle.style!.color, CupertinoColors.activeGreen.color);
362+
expect(textStyle.style.color, CupertinoColors.activeGreen.color);
363363
expect(iconTheme.data.color, CupertinoColors.lightBackgroundGray);
364364
expect(getBackgroundColor(tester, 0), CupertinoColors.lightBackgroundGray);
365365
expect(getBackgroundColor(tester, 1), CupertinoColors.activeGreen.color);

packages/flutter/test/cupertino/sliding_segmented_control_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void main() {
254254

255255
DefaultTextStyle textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first);
256256

257-
expect(textStyle.style!.fontWeight, FontWeight.w500);
257+
expect(textStyle.style.fontWeight, FontWeight.w500);
258258

259259
await tester.tap(find.byIcon(const IconData(1)));
260260
await tester.pump();
@@ -263,7 +263,7 @@ void main() {
263263
textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first);
264264

265265
expect(groupValue, 1);
266-
expect(textStyle.style!.fontWeight, FontWeight.normal);
266+
expect(textStyle.style.fontWeight, FontWeight.normal);
267267
},
268268
);
269269

packages/flutter/test/cupertino/tab_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void main() {
245245
builder: (BuildContext context) => CupertinoButton(
246246
child: const Text('home'),
247247
onPressed: () {
248-
Navigator.of(context).restorablePushNamed('/2');
248+
Navigator.of(context)!.restorablePushNamed('/2');
249249
},
250250
),
251251
routes: <String, WidgetBuilder>{
@@ -269,7 +269,7 @@ void main() {
269269
expect(find.text('home'), findsNothing);
270270
expect(find.text('second route'), findsOneWidget);
271271

272-
Navigator.of(tester.element(find.text('second route'))).pop();
272+
Navigator.of(tester.element(find.text('second route')))!.pop();
273273
await tester.pumpAndSettle();
274274

275275
expect(find.text('home'), findsOneWidget);
@@ -280,7 +280,7 @@ void main() {
280280
expect(find.text('home'), findsNothing);
281281
expect(find.text('second route'), findsOneWidget);
282282

283-
Navigator.of(tester.element(find.text('second route'))).pop();
283+
Navigator.of(tester.element(find.text('second route')))!.pop();
284284
await tester.pumpAndSettle();
285285

286286
expect(find.text('home'), findsOneWidget);

0 commit comments

Comments
 (0)