From e9c94e6c455f2aaed555056b02449b7df32d3124 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 6 Oct 2020 17:41:21 -0700 Subject: [PATCH] fix build analysis errors (#67476) --- .../test/cupertino/segmented_control_test.dart | 12 ++++++------ .../cupertino/sliding_segmented_control_test.dart | 4 ++-- packages/flutter/test/cupertino/tab_test.dart | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/flutter/test/cupertino/segmented_control_test.dart b/packages/flutter/test/cupertino/segmented_control_test.dart index 4607b7efb9..00085368e6 100644 --- a/packages/flutter/test/cupertino/segmented_control_test.dart +++ b/packages/flutter/test/cupertino/segmented_control_test.dart @@ -256,7 +256,7 @@ void main() { DefaultTextStyle textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1')); IconTheme iconTheme = tester.widget(find.widgetWithIcon(IconTheme, const IconData(1))); - expect(textStyle.style!.color, isSameColorAs(CupertinoColors.white)); + expect(textStyle.style.color, isSameColorAs(CupertinoColors.white)); expect(iconTheme.data.color, CupertinoColors.activeBlue); await tester.tap(find.widgetWithIcon(IconTheme, const IconData(1))); @@ -265,7 +265,7 @@ void main() { textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1')); iconTheme = tester.widget(find.widgetWithIcon(IconTheme, const IconData(1))); - expect(textStyle.style!.color, CupertinoColors.activeBlue); + expect(textStyle.style.color, CupertinoColors.activeBlue); expect(iconTheme.data.color, isSameColorAs(CupertinoColors.white)); }); @@ -300,7 +300,7 @@ void main() { DefaultTextStyle textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first); IconThemeData iconTheme = IconTheme.of(tester.element(find.byIcon(const IconData(1)))); - expect(textStyle.style!.color, isSameColorAs(CupertinoColors.black)); + expect(textStyle.style.color, isSameColorAs(CupertinoColors.black)); expect(iconTheme.color, isSameColorAs(CupertinoColors.systemBlue.darkColor)); await tester.tap(find.byIcon(const IconData(1))); @@ -310,7 +310,7 @@ void main() { textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first); iconTheme = IconTheme.of(tester.element(find.byIcon(const IconData(1)))); - expect(textStyle.style!.color, isSameColorAs(CupertinoColors.systemBlue.darkColor)); + expect(textStyle.style.color, isSameColorAs(CupertinoColors.systemBlue.darkColor)); expect(iconTheme.color, isSameColorAs(CupertinoColors.black)); }, ); @@ -348,7 +348,7 @@ void main() { IconTheme iconTheme = tester.widget(find.widgetWithIcon(IconTheme, const IconData(1))); expect(getRenderSegmentedControl(tester).borderColor, CupertinoColors.black); - expect(textStyle.style!.color, CupertinoColors.lightBackgroundGray); + expect(textStyle.style.color, CupertinoColors.lightBackgroundGray); expect(iconTheme.data.color, CupertinoColors.activeGreen.color); expect(getBackgroundColor(tester, 0), CupertinoColors.activeGreen.color); expect(getBackgroundColor(tester, 1), CupertinoColors.lightBackgroundGray); @@ -359,7 +359,7 @@ void main() { textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1')); iconTheme = tester.widget(find.widgetWithIcon(IconTheme, const IconData(1))); - expect(textStyle.style!.color, CupertinoColors.activeGreen.color); + expect(textStyle.style.color, CupertinoColors.activeGreen.color); expect(iconTheme.data.color, CupertinoColors.lightBackgroundGray); expect(getBackgroundColor(tester, 0), CupertinoColors.lightBackgroundGray); expect(getBackgroundColor(tester, 1), CupertinoColors.activeGreen.color); diff --git a/packages/flutter/test/cupertino/sliding_segmented_control_test.dart b/packages/flutter/test/cupertino/sliding_segmented_control_test.dart index 0f80e8e06f..dded3ca28b 100644 --- a/packages/flutter/test/cupertino/sliding_segmented_control_test.dart +++ b/packages/flutter/test/cupertino/sliding_segmented_control_test.dart @@ -254,7 +254,7 @@ void main() { DefaultTextStyle textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first); - expect(textStyle.style!.fontWeight, FontWeight.w500); + expect(textStyle.style.fontWeight, FontWeight.w500); await tester.tap(find.byIcon(const IconData(1))); await tester.pump(); @@ -263,7 +263,7 @@ void main() { textStyle = tester.widget(find.widgetWithText(DefaultTextStyle, 'Child 1').first); expect(groupValue, 1); - expect(textStyle.style!.fontWeight, FontWeight.normal); + expect(textStyle.style.fontWeight, FontWeight.normal); }, ); diff --git a/packages/flutter/test/cupertino/tab_test.dart b/packages/flutter/test/cupertino/tab_test.dart index 3de11516f2..495b4191a4 100644 --- a/packages/flutter/test/cupertino/tab_test.dart +++ b/packages/flutter/test/cupertino/tab_test.dart @@ -245,7 +245,7 @@ void main() { builder: (BuildContext context) => CupertinoButton( child: const Text('home'), onPressed: () { - Navigator.of(context).restorablePushNamed('/2'); + Navigator.of(context)!.restorablePushNamed('/2'); }, ), routes: { @@ -269,7 +269,7 @@ void main() { expect(find.text('home'), findsNothing); expect(find.text('second route'), findsOneWidget); - Navigator.of(tester.element(find.text('second route'))).pop(); + Navigator.of(tester.element(find.text('second route')))!.pop(); await tester.pumpAndSettle(); expect(find.text('home'), findsOneWidget); @@ -280,7 +280,7 @@ void main() { expect(find.text('home'), findsNothing); expect(find.text('second route'), findsOneWidget); - Navigator.of(tester.element(find.text('second route'))).pop(); + Navigator.of(tester.element(find.text('second route')))!.pop(); await tester.pumpAndSettle(); expect(find.text('home'), findsOneWidget);