From 35c9dec2a191c0b365a0f157cf4301d76581d9df Mon Sep 17 00:00:00 2001 From: Abhishek Ghaskata Date: Wed, 21 Apr 2021 04:24:03 +0530 Subject: [PATCH] MIgrate ios_platform_view_tests to null safety (#80619) --- .../ios_platform_view_tests/lib/main.dart | 10 +++++----- .../ios_platform_view_tests/pubspec.yaml | 2 +- .../ios_platform_view_tests/test_driver/main_test.dart | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dev/integration_tests/ios_platform_view_tests/lib/main.dart b/dev/integration_tests/ios_platform_view_tests/lib/main.dart index d1642ad9bf..4a9873aead 100644 --- a/dev/integration_tests/ios_platform_view_tests/lib/main.dart +++ b/dev/integration_tests/ios_platform_view_tests/lib/main.dart @@ -12,7 +12,7 @@ void main() { /// The main app entrance of the test class MyApp extends StatelessWidget { - const MyApp({Key key}) : super(key: key); + const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -30,8 +30,8 @@ class MyApp extends StatelessWidget { /// /// On press the button, a page with platform view should be pushed into the scene. class MyHomePage extends StatefulWidget { - const MyHomePage({Key key, this.title}) : super(key: key); - final String title; + const MyHomePage({Key? key, this.title}) : super(key: key); + final String? title; @override _MyHomePageState createState() => _MyHomePageState(); @@ -42,7 +42,7 @@ class _MyHomePageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text(widget.title), + title: Text(widget.title ?? ''), ), body: Column(children: [ TextButton( @@ -69,7 +69,7 @@ class _MyHomePageState extends State { /// A page contains the platform view to be tested. class PlatformViewPage extends StatelessWidget { - const PlatformViewPage({Key key}) : super(key: key); + const PlatformViewPage({Key? key}) : super(key: key); static Key button = const ValueKey('plus_button'); diff --git a/dev/integration_tests/ios_platform_view_tests/pubspec.yaml b/dev/integration_tests/ios_platform_view_tests/pubspec.yaml index dbf9012c77..d0781ae83d 100644 --- a/dev/integration_tests/ios_platform_view_tests/pubspec.yaml +++ b/dev/integration_tests/ios_platform_view_tests/pubspec.yaml @@ -3,7 +3,7 @@ name: ios_platform_view_tests version: 1.0.0+1 environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: diff --git a/dev/integration_tests/ios_platform_view_tests/test_driver/main_test.dart b/dev/integration_tests/ios_platform_view_tests/test_driver/main_test.dart index 7ae217fc81..ed36c7dab3 100644 --- a/dev/integration_tests/ios_platform_view_tests/test_driver/main_test.dart +++ b/dev/integration_tests/ios_platform_view_tests/test_driver/main_test.dart @@ -8,7 +8,7 @@ import 'package:test/test.dart' hide TypeMatcher, isInstanceOf; void main() { group('FlutterDriver', () { - FlutterDriver driver; + late FlutterDriver driver; setUpAll(() async { driver = await FlutterDriver.connect();