Skip to content

Commit 93a74ca

Browse files
authored
remove unused members in executable libs (#107464)
1 parent cfff88b commit 93a74ca

15 files changed

+2
-87
lines changed

dev/benchmarks/test_apps/stocks/test/icon_color_test.dart

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ Element? findElementOfExactWidgetTypeGoingUp(Element node, Type targetType) {
3434
return result;
3535
}
3636

37-
final RegExp materialIconAssetNameColorExtractor = RegExp(r'[^/]+/ic_.+_(white|black)_[0-9]+dp\.png');
38-
3937
void checkIconColor(WidgetTester tester, String label, Color color) {
4038
final Element listTile = findElementOfExactWidgetTypeGoingUp(tester.element(find.text(label)), ListTile)!;
4139
final Element asset = findElementOfExactWidgetTypeGoingDown(listTile, RichText)!;

dev/bots/analyze.dart

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ late final String dart;
3232
/// The path to the `pub` executable; set at the top of `main`
3333
late final String pub;
3434

35-
final String pubCache = path.join(flutterRoot, '.pub-cache');
36-
3735
/// When you call this, you can pass additional arguments to pass custom
3836
/// arguments to flutter analyze. For example, you might want to call this
3937
/// script with the parameter --dart-sdk to use custom dart sdk.

dev/bots/test.dart

-38
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(P
3535
final String flutter = path.join(flutterRoot, 'bin', 'flutter$bat');
3636
final String dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', 'dart$exe');
3737
final String pubCache = path.join(flutterRoot, '.pub-cache');
38-
final String toolRoot = path.join(flutterRoot, 'packages', 'flutter_tools');
3938
final String engineVersionFile = path.join(flutterRoot, 'bin', 'internal', 'engine.version');
4039
final String flutterPluginsVersionFile = path.join(flutterRoot, 'bin', 'internal', 'flutter_plugins.version');
4140

@@ -1812,31 +1811,6 @@ void adjustEnvironmentToEnableFlutterAsserts(Map<String, String> environment) {
18121811
environment['FLUTTER_TOOL_ARGS'] = toolsArgs.trim();
18131812
}
18141813

1815-
Map<String, String> _initGradleEnvironment() {
1816-
final String? androidSdkRoot = (Platform.environment['ANDROID_HOME']?.isEmpty ?? true)
1817-
? Platform.environment['ANDROID_SDK_ROOT']
1818-
: Platform.environment['ANDROID_HOME'];
1819-
if (androidSdkRoot == null || androidSdkRoot.isEmpty) {
1820-
print('${red}Could not find Android SDK; set ANDROID_SDK_ROOT.$reset');
1821-
exit(1);
1822-
}
1823-
return <String, String>{
1824-
'ANDROID_HOME': androidSdkRoot!,
1825-
'ANDROID_SDK_ROOT': androidSdkRoot,
1826-
};
1827-
}
1828-
1829-
final Map<String, String> gradleEnvironment = _initGradleEnvironment();
1830-
1831-
void deleteFile(String path) {
1832-
// This is technically a race condition but nobody else should be running
1833-
// while this script runs, so we should be ok. (Sadly recursive:true does not
1834-
// obviate the need for existsSync, at least on Windows.)
1835-
final File file = File(path);
1836-
if (file.existsSync())
1837-
file.deleteSync();
1838-
}
1839-
18401814
enum CiProviders {
18411815
cirrus,
18421816
luci,
@@ -1865,18 +1839,6 @@ CiProviders? get ciProvider {
18651839
return null;
18661840
}
18671841

1868-
/// Returns the name of the branch being tested.
1869-
String get branchName {
1870-
switch(ciProvider) {
1871-
case CiProviders.cirrus:
1872-
return Platform.environment['CIRRUS_BRANCH']!;
1873-
case CiProviders.luci:
1874-
return Platform.environment['LUCI_BRANCH']!;
1875-
case null:
1876-
return '';
1877-
}
1878-
}
1879-
18801842
/// Checks the given file's contents to determine if they match the allowed
18811843
/// pattern for version strings.
18821844
///

dev/bots/unpublish_package.dart

-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import 'dart:async';
1515
import 'dart:convert';
1616
import 'dart:io' hide Platform;
17-
import 'dart:typed_data';
1817

1918
import 'package:args/args.dart';
2019
import 'package:path/path.dart' as path;
@@ -210,8 +209,6 @@ class ProcessRunner {
210209
}
211210
}
212211

213-
typedef HttpReader = Future<Uint8List> Function(Uri url, {Map<String, String> headers});
214-
215212
class ArchiveUnpublisher {
216213
ArchiveUnpublisher(
217214
this.tempDir,

dev/devicelab/bin/tasks/build_aar_module_test.dart

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import 'package:path/path.dart' as path;
1212

1313
final String platformLineSep = Platform.isWindows ? '\r\n': '\n';
1414

15-
16-
final String gradlew = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
17-
final String gradlewExecutable = Platform.isWindows ? '.\\$gradlew' : './$gradlew';
18-
1915
/// Tests that AARs can be built on module projects.
2016
Future<void> main() async {
2117
await task(() async {

dev/devicelab/bin/tasks/fast_scroll_heavy_gridview__memory.dart

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'package:flutter_devicelab/framework/utils.dart';
88
import 'package:flutter_devicelab/tasks/perf_tests.dart';
99

1010
const String kPackageName = 'com.example.macrobenchmarks';
11-
const String kActivityName = 'com.example.macrobenchmarks.MainActivity';
1211

1312
class FastScrollHeavyGridViewMemoryTest extends MemoryTest {
1413
FastScrollHeavyGridViewMemoryTest()

dev/devicelab/bin/tasks/fast_scroll_large_images__memory.dart

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'package:flutter_devicelab/framework/utils.dart';
88
import 'package:flutter_devicelab/tasks/perf_tests.dart';
99

1010
const String kPackageName = 'com.example.macrobenchmarks';
11-
const String kActivityName = 'com.example.macrobenchmarks.MainActivity';
1211

1312
class FastScrollLargeImagesMemoryTest extends MemoryTest {
1413
FastScrollLargeImagesMemoryTest()

dev/devicelab/bin/tasks/flutter_gallery_v2_chrome_run_test.dart

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ Future<void> main() async {
1616
await task(const NewGalleryChromeRunTest().run);
1717
}
1818

19-
/// URI for the New Flutter Gallery repository.
20-
const String galleryRepo = 'https://github.com/flutter/gallery.git';
21-
2219
/// After the gallery loads, a duration of [durationToWaitForError]
2320
/// is waited, allowing any possible exceptions to be thrown.
2421
const Duration durationToWaitForError = Duration(seconds: 5);

dev/devicelab/test/adb_test.dart

-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ CommandArgs cmd({
145145
);
146146
}
147147

148-
typedef ExitErrorFactory = dynamic Function();
149-
150148
@immutable
151149
class CommandArgs {
152150
const CommandArgs({ required this.command, this.arguments, this.environment });

dev/forbidden_from_release_tests/bin/main.dart

-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ import 'package:file/file.dart';
1010
import 'package:file/local.dart';
1111
import 'package:package_config/package_config.dart';
1212
import 'package:path/path.dart' as path;
13-
import 'package:process/process.dart';
1413
import 'package:vm_snapshot_analysis/program_info.dart';
1514
import 'package:vm_snapshot_analysis/v8_profile.dart';
1615

17-
const ProcessManager processManager = LocalProcessManager();
1816
const FileSystem fs = LocalFileSystem();
1917

2018
Future<void> main(List<String> args) async {

dev/integration_tests/web_e2e_tests/lib/image_loading_main.dart

+2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ final Completer<void> _assetImageCompleter = Completer<void>();
1111
final Completer<void> _networkImageCompleter = Completer<void>();
1212

1313
/// Notifies that Image.asset used in the test app loaded the image.
14+
@visibleForTesting
1415
Future<void> get whenAssetImageLoads => _assetImageCompleter.future;
1516

1617
/// Notifies that Image.network used in the test app loaded the image.
18+
@visibleForTesting
1719
Future<void> get whenNetworkImageLoads => _networkImageCompleter.future;
1820

1921
Future<void> main() async {

dev/manual_tests/lib/color_testing_demo.dart

-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@
44

55
import 'package:flutter/material.dart';
66

7-
class ColorTestingDemo extends StatelessWidget {
8-
const ColorTestingDemo({ super.key });
9-
10-
static const String routeName = '/color_demo';
11-
12-
@override
13-
Widget build(BuildContext context) => const ColorDemoHome();
14-
}
15-
167
class ColorDemoHome extends StatelessWidget {
178
const ColorDemoHome({super.key});
189

dev/manual_tests/lib/hover.dart

-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,6 @@ void main() {
1111
));
1212
}
1313

14-
class DemoButton extends StatelessWidget {
15-
const DemoButton({super.key, required this.name});
16-
17-
final String name;
18-
19-
void _handleOnPressed() {
20-
print('Button $name pressed.');
21-
}
22-
23-
@override
24-
Widget build(BuildContext context) {
25-
return TextButton(
26-
onPressed: () => _handleOnPressed(),
27-
child: Text(name),
28-
);
29-
}
30-
}
31-
3214
class HoverDemo extends StatefulWidget {
3315
const HoverDemo({super.key});
3416

dev/tools/dartdoc.dart

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import 'dartdoc_checker.dart';
1616

1717
const String kDocsRoot = 'dev/docs';
1818
const String kPublishRoot = '$kDocsRoot/doc';
19-
const String kSnippetsRoot = 'dev/snippets';
2019

2120
const String kDummyPackageName = 'Flutter';
2221
const String kPlatformIntegrationPackageName = 'platform_integration';

dev/tools/examples_smoke_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import 'package:path/path.dart' as path;
1717
import 'package:platform/platform.dart';
1818
import 'package:process/process.dart';
1919

20-
const bool kIsWeb = identical(0, 0.0);
2120
FileSystem filesystem = const LocalFileSystem();
2221
ProcessManager processManager = const LocalProcessManager();
2322
Platform platform = const LocalPlatform();

0 commit comments

Comments
 (0)