diff --git a/packages/flutter_tools/lib/src/base/project_migrator.dart b/packages/flutter_tools/lib/src/base/project_migrator.dart index 1ba453f44e..151dab5689 100644 --- a/packages/flutter_tools/lib/src/base/project_migrator.dart +++ b/packages/flutter_tools/lib/src/base/project_migrator.dart @@ -21,7 +21,7 @@ abstract class ProjectMigrator { /// Return null if the line should be deleted. @protected - String migrateLine(String line) { + String? migrateLine(String line) { return line; } @@ -41,7 +41,7 @@ abstract class ProjectMigrator { bool migrationRequired = false; for (final String line in lines) { - final String newProjectLine = migrateLine(line); + final String? newProjectLine = migrateLine(line); if (newProjectLine == null) { logger.printTrace('Migrating $basename, removing:'); logger.printTrace(' $line'); diff --git a/packages/flutter_tools/lib/src/ios/migrations/project_base_configuration_migration.dart b/packages/flutter_tools/lib/src/ios/migrations/project_base_configuration_migration.dart index 490a4b88c1..329dd9d99f 100644 --- a/packages/flutter_tools/lib/src/ios/migrations/project_base_configuration_migration.dart +++ b/packages/flutter_tools/lib/src/ios/migrations/project_base_configuration_migration.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.8 - import '../../base/file_system.dart'; import '../../base/logger.dart'; import '../../base/project_migrator.dart'; @@ -41,7 +39,7 @@ class ProjectBaseConfigurationMigration extends ProjectMigrator { multiLine: true, ); - final RegExpMatch match = projectBuildConfigurationList.firstMatch(originalProjectContents); + final RegExpMatch? match = projectBuildConfigurationList.firstMatch(originalProjectContents); // If the PBXProject "Runner" build configuration identifiers can't be parsed, default to the generated template identifiers. final String debugIdentifier = match?.group(1) ?? '97C147031CF9000F007C117D'; diff --git a/packages/flutter_tools/lib/src/ios/migrations/project_build_location_migration.dart b/packages/flutter_tools/lib/src/ios/migrations/project_build_location_migration.dart index a4266aa722..e0bed32027 100644 --- a/packages/flutter_tools/lib/src/ios/migrations/project_build_location_migration.dart +++ b/packages/flutter_tools/lib/src/ios/migrations/project_build_location_migration.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.8 - import '../../base/file_system.dart'; import '../../base/logger.dart'; import '../../base/project_migrator.dart'; diff --git a/packages/flutter_tools/lib/src/ios/migrations/remove_framework_link_and_embedding_migration.dart b/packages/flutter_tools/lib/src/ios/migrations/remove_framework_link_and_embedding_migration.dart index 29d1ea1294..3ad65dfd55 100644 --- a/packages/flutter_tools/lib/src/ios/migrations/remove_framework_link_and_embedding_migration.dart +++ b/packages/flutter_tools/lib/src/ios/migrations/remove_framework_link_and_embedding_migration.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.8 - import '../../base/common.dart'; import '../../base/file_system.dart'; import '../../base/logger.dart'; @@ -39,7 +37,7 @@ class RemoveFrameworkLinkAndEmbeddingMigration extends ProjectMigrator { } @override - String migrateLine(String line) { + String? migrateLine(String line) { // App.framework Frameworks reference. // isa = PBXFrameworksBuildPhase; // files = ( diff --git a/packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart b/packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart index 9675ee3bd8..4472e2acf2 100644 --- a/packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart +++ b/packages/flutter_tools/lib/src/ios/migrations/xcode_build_system_migration.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.8 - import '../../base/file_system.dart'; import '../../base/logger.dart'; import '../../base/project_migrator.dart'; diff --git a/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart index 4806869a87..be4b80c493 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_project_migration_test.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.8 - import 'package:file/file.dart'; import 'package:file/memory.dart'; import 'package:flutter_tools/src/base/logger.dart'; @@ -14,14 +12,13 @@ import 'package:flutter_tools/src/ios/migrations/remove_framework_link_and_embed import 'package:flutter_tools/src/ios/migrations/xcode_build_system_migration.dart'; import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/reporting/reporting.dart'; -import 'package:meta/meta.dart'; import 'package:test/fake.dart'; import '../../src/common.dart'; void main () { group('iOS migration', () { - TestUsage testUsage; + late TestUsage testUsage; setUp(() { testUsage = TestUsage(); @@ -40,10 +37,10 @@ void main () { }); group('remove framework linking and embedding migration', () { - MemoryFileSystem memoryFileSystem; - BufferLogger testLogger; - FakeIosProject project; - File xcodeProjectInfoFile; + late MemoryFileSystem memoryFileSystem; + late BufferLogger testLogger; + late FakeIosProject project; + late File xcodeProjectInfoFile; setUp(() { memoryFileSystem = MemoryFileSystem.test(); @@ -187,10 +184,10 @@ keep this 2 }); group('new Xcode build system', () { - MemoryFileSystem memoryFileSystem; - BufferLogger testLogger; - FakeIosProject project; - File xcodeWorkspaceSharedSettings; + late MemoryFileSystem memoryFileSystem; + late BufferLogger testLogger; + late FakeIosProject project; + late File xcodeWorkspaceSharedSettings; setUp(() { memoryFileSystem = MemoryFileSystem.test(); @@ -259,10 +256,10 @@ keep this 2 }); group('Xcode default build location', () { - MemoryFileSystem memoryFileSystem; - BufferLogger testLogger; - FakeIosProject project; - File xcodeProjectWorkspaceData; + late MemoryFileSystem memoryFileSystem; + late BufferLogger testLogger; + late FakeIosProject project; + late File xcodeProjectWorkspaceData; setUp(() { memoryFileSystem = MemoryFileSystem(); @@ -338,10 +335,10 @@ keep this 2 }); group('remove Runner project base configuration', () { - MemoryFileSystem memoryFileSystem; - BufferLogger testLogger; - FakeIosProject project; - File xcodeProjectInfoFile; + late MemoryFileSystem memoryFileSystem; + late BufferLogger testLogger; + late FakeIosProject project; + late File xcodeProjectInfoFile; setUp(() { memoryFileSystem = MemoryFileSystem(); @@ -495,18 +492,18 @@ keep this 3 class FakeIosProject extends Fake implements IosProject { @override - File xcodeProjectWorkspaceData; + File xcodeProjectWorkspaceData = MemoryFileSystem.test().file('xcodeProjectWorkspaceData'); @override - File xcodeWorkspaceSharedSettings; + File xcodeWorkspaceSharedSettings = MemoryFileSystem.test().file('xcodeWorkspaceSharedSettings'); @override - File xcodeProjectInfoFile; + File xcodeProjectInfoFile = MemoryFileSystem.test().file('xcodeProjectInfoFile'); } class FakeIOSMigrator extends ProjectMigrator { - FakeIOSMigrator({@required this.succeeds}) - : super(null); + FakeIOSMigrator({required this.succeeds}) + : super(BufferLogger.test()); final bool succeeds;