Skip to content

Commit 5d2da5a

Browse files
committed
Remove and also ignore unnecessary imports
In each library where an import is removed, the library uses some elements provided by the import, BUT there is another import which provides all of the same elements, and at least one more which the library uses. In this change, we remove the imports which can be simply removed in favor of the other already present imports. Additionally, I add an ignore to analysis_options.yaml, so that unnecessary_import can land in Dart. After it lands, we can clean up the remaining cases in flutter. See dart-lang/sdk#44569 for more information.
1 parent ff5dd54 commit 5d2da5a

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

analysis_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ analyzer:
3636
# Stream and not importing dart:async
3737
# Please see https://github.com/flutter/flutter/pull/24528 for details.
3838
sdk_version_async_exported_from_core: ignore
39+
# TODO(https://github.com/flutter/flutter/issues/74381):
40+
# Clean up existing unnecessary imports, and remove line to ignore.
41+
unnecessary_import: ignore
3942
# Turned off until null-safe rollout is complete.
4043
unnecessary_null_comparison: ignore
4144
exclude:

dev/integration_tests/deferred_components_test/lib/component1.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
library component1;
66

77
import 'package:flutter/material.dart';
8-
import 'package:flutter/widgets.dart';
98

109

1110
class LogoScreen extends StatelessWidget {

dev/integration_tests/deferred_components_test/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import 'dart:async';
66

77
import 'package:flutter/material.dart';
8-
import 'package:flutter/widgets.dart';
98
import 'package:flutter_driver/driver_extension.dart';
109

1110
import 'component1.dart' deferred as component1;

dev/tools/test/dartdoc_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// found in the LICENSE file.
44

55
import 'package:platform/platform.dart';
6-
import 'package:process/process.dart';
76
import 'package:test/test.dart';
87

98
import '../../../packages/flutter_tools/test/src/fake_process_manager.dart';

0 commit comments

Comments
 (0)