From 555cb66ece446f2b4e85f5150a5138db3c876665 Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Tue, 6 Oct 2020 14:38:19 +0200 Subject: [PATCH] fix tree (#67410) --- .../flutter/test/cupertino/action_sheet_test.dart | 14 +++++++------- packages/flutter/test/cupertino/button_test.dart | 8 ++++---- .../test/cupertino/context_menu_action_test.dart | 2 +- packages/flutter/test/cupertino/dialog_test.dart | 14 +++++++------- packages/flutter/test/cupertino/nav_bar_test.dart | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/flutter/test/cupertino/action_sheet_test.dart b/packages/flutter/test/cupertino/action_sheet_test.dart index 0f37a62e25..d603815d38 100644 --- a/packages/flutter/test/cupertino/action_sheet_test.dart +++ b/packages/flutter/test/cupertino/action_sheet_test.dart @@ -61,7 +61,7 @@ void main() { final DefaultTextStyle widget = tester.widget(find.widgetWithText(DefaultTextStyle, 'Ok')); - expect(widget.style!.color, const CupertinoDynamicColor.withBrightnessAndContrast( + expect(widget.style.color, const CupertinoDynamicColor.withBrightnessAndContrast( color: Color.fromARGB(255, 255, 59, 48), darkColor: Color.fromARGB(255, 255, 69, 58), highContrastColor: Color.fromARGB(255, 215, 0, 21), @@ -84,7 +84,7 @@ void main() { of: find.widgetWithText(CupertinoActionSheetAction, text), matching: find.byType(DefaultTextStyle), ), - ).style!; + ).style; } await tester.pumpWidget( @@ -139,7 +139,7 @@ void main() { final DefaultTextStyle widget = tester.widget(find.widgetWithText(DefaultTextStyle, 'Ok')); - expect(widget.style!.fontWeight, equals(FontWeight.w600)); + expect(widget.style.fontWeight, equals(FontWeight.w600)); }); testWidgets('Action sheet text styles are correct when both title and message are included', (WidgetTester tester) async { @@ -160,8 +160,8 @@ void main() { final DefaultTextStyle messageStyle = tester.firstWidget(find.widgetWithText(DefaultTextStyle, 'An action sheet')); - expect(titleStyle.style!.fontWeight, FontWeight.w600); - expect(messageStyle.style!.fontWeight, FontWeight.w400); + expect(titleStyle.style.fontWeight, FontWeight.w600); + expect(messageStyle.style.fontWeight, FontWeight.w400); }); testWidgets('Action sheet text styles are correct when title but no message is included', (WidgetTester tester) async { @@ -179,7 +179,7 @@ void main() { final DefaultTextStyle titleStyle = tester.firstWidget(find.widgetWithText(DefaultTextStyle, 'Action Sheet')); - expect(titleStyle.style!.fontWeight, FontWeight.w400); + expect(titleStyle.style.fontWeight, FontWeight.w400); }); testWidgets('Action sheet text styles are correct when message but no title is included', (WidgetTester tester) async { @@ -197,7 +197,7 @@ void main() { final DefaultTextStyle messageStyle = tester.firstWidget(find.widgetWithText(DefaultTextStyle, 'An action sheet')); - expect(messageStyle.style!.fontWeight, FontWeight.w600); + expect(messageStyle.style.fontWeight, FontWeight.w600); }); testWidgets('Content section but no actions', (WidgetTester tester) async { diff --git a/packages/flutter/test/cupertino/button_test.dart b/packages/flutter/test/cupertino/button_test.dart index 3d221b443c..fa7516d486 100644 --- a/packages/flutter/test/cupertino/button_test.dart +++ b/packages/flutter/test/cupertino/button_test.dart @@ -323,7 +323,7 @@ void main() { home: CupertinoButton( onPressed: () { }, child: Builder(builder: (BuildContext context) { - textStyle = DefaultTextStyle.of(context).style!; + textStyle = DefaultTextStyle.of(context).style; return const Placeholder(); }), ), @@ -337,7 +337,7 @@ void main() { home: CupertinoButton.filled( onPressed: () { }, child: Builder(builder: (BuildContext context) { - textStyle = DefaultTextStyle.of(context).style!; + textStyle = DefaultTextStyle.of(context).style; return const Placeholder(); }), ), @@ -359,7 +359,7 @@ void main() { home: CupertinoButton( onPressed: () { }, child: Builder(builder: (BuildContext context) { - textStyle = DefaultTextStyle.of(context).style!; + textStyle = DefaultTextStyle.of(context).style; return const Placeholder(); }), ), @@ -373,7 +373,7 @@ void main() { home: CupertinoButton.filled( onPressed: () { }, child: Builder(builder: (BuildContext context) { - textStyle = DefaultTextStyle.of(context).style!; + textStyle = DefaultTextStyle.of(context).style; return const Placeholder(); }), ), diff --git a/packages/flutter/test/cupertino/context_menu_action_test.dart b/packages/flutter/test/cupertino/context_menu_action_test.dart index 278810b024..38b40a58ad 100644 --- a/packages/flutter/test/cupertino/context_menu_action_test.dart +++ b/packages/flutter/test/cupertino/context_menu_action_test.dart @@ -50,7 +50,7 @@ void main() { ); expect(finder, findsOneWidget); final DefaultTextStyle defaultStyle = tester.widget(finder); - return defaultStyle.style!; + return defaultStyle.style; } Icon _getIcon(WidgetTester tester) { diff --git a/packages/flutter/test/cupertino/dialog_test.dart b/packages/flutter/test/cupertino/dialog_test.dart index 6d70a73b0d..05890a4756 100644 --- a/packages/flutter/test/cupertino/dialog_test.dart +++ b/packages/flutter/test/cupertino/dialog_test.dart @@ -116,7 +116,7 @@ void main() { final DefaultTextStyle widget = tester.widget(find.byType(DefaultTextStyle)); - expect(widget.style!.color!.withAlpha(255), CupertinoColors.systemRed.color); + expect(widget.style.color!.withAlpha(255), CupertinoColors.systemRed.color); }); testWidgets('Dialog dark theme', (WidgetTester tester) async { @@ -231,7 +231,7 @@ void main() { final DefaultTextStyle widget = tester.widget(find.byType(DefaultTextStyle)); - expect(widget.style!.fontWeight, equals(FontWeight.w600)); + expect(widget.style.fontWeight, equals(FontWeight.w600)); }); testWidgets('Dialog default and destructive action styles', (WidgetTester tester) async { @@ -243,8 +243,8 @@ void main() { final DefaultTextStyle widget = tester.widget(find.byType(DefaultTextStyle)); - expect(widget.style!.color!.withAlpha(255), CupertinoColors.systemRed.color); - expect(widget.style!.fontWeight, equals(FontWeight.w600)); + expect(widget.style.color!.withAlpha(255), CupertinoColors.systemRed.color); + expect(widget.style.fontWeight, equals(FontWeight.w600)); }); testWidgets('Dialog disabled action style', (WidgetTester tester) async { @@ -254,8 +254,8 @@ void main() { final DefaultTextStyle widget = tester.widget(find.byType(DefaultTextStyle)); - expect(widget.style!.color!.opacity, greaterThanOrEqualTo(127 / 255)); - expect(widget.style!.color!.opacity, lessThanOrEqualTo(128 / 255)); + expect(widget.style.color!.opacity, greaterThanOrEqualTo(127 / 255)); + expect(widget.style.color!.opacity, lessThanOrEqualTo(128 / 255)); }); testWidgets('Dialog enabled action style', (WidgetTester tester) async { @@ -266,7 +266,7 @@ void main() { final DefaultTextStyle widget = tester.widget(find.byType(DefaultTextStyle)); - expect(widget.style!.color!.opacity, equals(1.0)); + expect(widget.style.color!.opacity, equals(1.0)); }); testWidgets('Message is scrollable, has correct padding with large text sizes', (WidgetTester tester) async { diff --git a/packages/flutter/test/cupertino/nav_bar_test.dart b/packages/flutter/test/cupertino/nav_bar_test.dart index 7ef0f6562d..1be94923dc 100644 --- a/packages/flutter/test/cupertino/nav_bar_test.dart +++ b/packages/flutter/test/cupertino/nav_bar_test.dart @@ -1198,7 +1198,7 @@ class _ExpectStyles extends StatelessWidget { @override Widget build(BuildContext context) { - final TextStyle style = DefaultTextStyle.of(context).style!; + final TextStyle style = DefaultTextStyle.of(context).style; expect(style.color, isSameColorAs(color)); expect(style.fontFamily, '.SF Pro Text'); expect(style.fontSize, 17.0);