Skip to content

Commit dcde816

Browse files
authored
migrate to super params (#100509)
1 parent baa45a1 commit dcde816

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+188
-341
lines changed

packages/flutter_tools/lib/src/android/android_device.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const Map<String, HardwareType> kKnownHardware = <String, HardwareType>{
5656
/// map to specify that they are actually physical devices.
5757
class AndroidDevice extends Device {
5858
AndroidDevice(
59-
String id, {
59+
super.id, {
6060
this.productID,
6161
required this.modelID,
6262
this.deviceCodeName,
@@ -74,7 +74,6 @@ class AndroidDevice extends Device {
7474
_androidConsoleSocketFactory = androidConsoleSocketFactory,
7575
_processUtils = ProcessUtils(logger: logger, processManager: processManager),
7676
super(
77-
id,
7877
category: Category.mobile,
7978
platformType: PlatformType.android,
8079
ephemeral: true,

packages/flutter_tools/lib/src/android/application_package.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ import 'gradle.dart';
2323
/// An application package created from an already built Android APK.
2424
class AndroidApk extends ApplicationPackage implements PrebuiltApplicationPackage {
2525
AndroidApk({
26-
required String id,
26+
required super.id,
2727
required this.applicationPackage,
2828
required this.versionCode,
2929
required this.launchActivity,
3030
}) : assert(applicationPackage != null),
31-
assert(launchActivity != null),
32-
super(id: id);
31+
assert(launchActivity != null);
3332

3433
/// Creates a new AndroidApk from an existing APK.
3534
///

packages/flutter_tools/lib/src/android/deferred_components_prebuild_validator.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import '../base/deferred_component.dart';
88
import '../base/error_handling_io.dart';
99
import '../base/file_system.dart';
1010
import '../base/logger.dart';
11-
import '../base/platform.dart';
1211
import '../globals.dart' as globals;
1312
import '../project.dart';
1413
import '../template.dart';
@@ -29,12 +28,11 @@ class DeferredComponentsPrebuildValidator extends DeferredComponentsValidator {
2928
/// When [exitOnFail] is set to true, the [handleResults] and [attemptToolExit]
3029
/// methods will exit the tool when this validator detects a recommended
3130
/// change. This defaults to true.
32-
DeferredComponentsPrebuildValidator(Directory projectDir, Logger logger, Platform platform, {
33-
bool exitOnFail = true,
34-
String? title,
31+
DeferredComponentsPrebuildValidator(super.projectDir, super.logger, super.platform, {
32+
super.exitOnFail,
33+
super.title,
3534
Directory? templatesDir,
36-
}) : _templatesDir = templatesDir,
37-
super(projectDir, logger, platform, exitOnFail: exitOnFail, title: title);
35+
}) : _templatesDir = templatesDir;
3836

3937
final Directory? _templatesDir;
4038

packages/flutter_tools/lib/src/base/io.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ class ProcessSignal {
209209
@visibleForTesting
210210
class PosixProcessSignal extends ProcessSignal {
211211

212-
const PosixProcessSignal(io.ProcessSignal wrappedSignal, {@visibleForTesting Platform platform = const LocalPlatform()})
213-
: super(wrappedSignal, platform: platform);
212+
const PosixProcessSignal(super.wrappedSignal, {@visibleForTesting super.platform});
214213

215214
@override
216215
Stream<ProcessSignal> watch() {

packages/flutter_tools/lib/src/base/logger.dart

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -706,16 +706,11 @@ int _getColumnSize(String line) {
706706
/// they will show up as the unrepresentable character symbol '�'.
707707
class WindowsStdoutLogger extends StdoutLogger {
708708
WindowsStdoutLogger({
709-
required Terminal terminal,
710-
required Stdio stdio,
711-
required OutputPreferences outputPreferences,
712-
StopwatchFactory stopwatchFactory = const StopwatchFactory(),
713-
}) : super(
714-
terminal: terminal,
715-
stdio: stdio,
716-
outputPreferences: outputPreferences,
717-
stopwatchFactory: stopwatchFactory,
718-
);
709+
required super.terminal,
710+
required super.stdio,
711+
required super.outputPreferences,
712+
super.stopwatchFactory,
713+
});
719714

720715
@override
721716
void writeToStdOut(String message) {
@@ -906,11 +901,10 @@ class BufferLogger extends Logger {
906901
}
907902

908903
class VerboseLogger extends DelegatingLogger {
909-
VerboseLogger(Logger parent, {
904+
VerboseLogger(super.parent, {
910905
StopwatchFactory stopwatchFactory = const StopwatchFactory()
911906
}) : _stopwatch = stopwatchFactory.createStopwatch(),
912-
_stopwatchFactory = stopwatchFactory,
913-
super(parent) {
907+
_stopwatchFactory = stopwatchFactory {
914908
_stopwatch.start();
915909
}
916910

@@ -1081,7 +1075,7 @@ class VerboseLogger extends DelegatingLogger {
10811075
}
10821076

10831077
class PrefixedErrorLogger extends DelegatingLogger {
1084-
PrefixedErrorLogger(Logger parent) : super(parent);
1078+
PrefixedErrorLogger(super.parent);
10851079

10861080
@override
10871081
void printError(
@@ -1186,12 +1180,9 @@ abstract class Status {
11861180
/// A [Status] that shows nothing.
11871181
class SilentStatus extends Status {
11881182
SilentStatus({
1189-
required Stopwatch stopwatch,
1190-
VoidCallback? onFinish,
1191-
}) : super(
1192-
onFinish: onFinish,
1193-
stopwatch: stopwatch,
1194-
);
1183+
required super.stopwatch,
1184+
super.onFinish,
1185+
});
11951186

11961187
@override
11971188
void finish() {
@@ -1206,15 +1197,11 @@ const int _kTimePadding = 8; // should fit "99,999ms"
12061197
class SummaryStatus extends Status {
12071198
SummaryStatus({
12081199
this.message = '',
1209-
required Stopwatch stopwatch,
1200+
required super.stopwatch,
12101201
this.padding = kDefaultStatusPadding,
1211-
VoidCallback? onFinish,
1202+
super.onFinish,
12121203
required Stdio stdio,
1213-
}) : _stdio = stdio,
1214-
super(
1215-
onFinish: onFinish,
1216-
stopwatch: stopwatch,
1217-
);
1204+
}) : _stdio = stdio;
12181205

12191206
final String message;
12201207
final int padding;
@@ -1270,20 +1257,15 @@ class SummaryStatus extends Status {
12701257
/// Call [pause] before outputting any text while this is running.
12711258
class AnonymousSpinnerStatus extends Status {
12721259
AnonymousSpinnerStatus({
1273-
VoidCallback? onFinish,
1274-
required Stopwatch stopwatch,
1260+
super.onFinish,
1261+
required super.stopwatch,
12751262
required Stdio stdio,
12761263
required Terminal terminal,
12771264
this.slowWarningCallback,
1278-
Duration? timeout,
1265+
super.timeout,
12791266
}) : _stdio = stdio,
12801267
_terminal = terminal,
1281-
_animation = _selectAnimation(terminal),
1282-
super(
1283-
onFinish: onFinish,
1284-
stopwatch: stopwatch,
1285-
timeout: timeout,
1286-
);
1268+
_animation = _selectAnimation(terminal);
12871269

12881270
final Stdio _stdio;
12891271
final Terminal _terminal;
@@ -1425,16 +1407,11 @@ class SpinnerStatus extends AnonymousSpinnerStatus {
14251407
SpinnerStatus({
14261408
required this.message,
14271409
this.padding = kDefaultStatusPadding,
1428-
VoidCallback? onFinish,
1429-
required Stopwatch stopwatch,
1430-
required Stdio stdio,
1431-
required Terminal terminal,
1432-
}) : super(
1433-
onFinish: onFinish,
1434-
stopwatch: stopwatch,
1435-
stdio: stdio,
1436-
terminal: terminal,
1437-
);
1410+
super.onFinish,
1411+
required super.stopwatch,
1412+
required super.stdio,
1413+
required super.terminal,
1414+
});
14381415

14391416
final String message;
14401417
final int padding;

packages/flutter_tools/lib/src/base/multi_root_file_system.dart

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,9 @@ abstract class MultiRootFileSystemEntity<T extends FileSystemEntity,
212212
class MultiRootFile extends MultiRootFileSystemEntity<File, io.File>
213213
with ForwardingFile {
214214
MultiRootFile({
215-
required MultiRootFileSystem fileSystem,
216-
required io.File delegate,
217-
}) : super(
218-
fileSystem: fileSystem,
219-
delegate: delegate,
220-
);
215+
required super.fileSystem,
216+
required super.delegate,
217+
});
221218

222219
@override
223220
String toString() =>
@@ -228,12 +225,9 @@ class MultiRootDirectory
228225
extends MultiRootFileSystemEntity<Directory, io.Directory>
229226
with ForwardingDirectory<Directory> {
230227
MultiRootDirectory({
231-
required MultiRootFileSystem fileSystem,
232-
required io.Directory delegate,
233-
}) : super(
234-
fileSystem: fileSystem,
235-
delegate: delegate,
236-
);
228+
required super.fileSystem,
229+
required super.delegate,
230+
});
237231

238232
// For the childEntity methods, we first obtain an instance of the entity
239233
// from the underlying file system, then invoke childEntity() on it, then
@@ -258,12 +252,9 @@ class MultiRootDirectory
258252
class MultiRootLink extends MultiRootFileSystemEntity<Link, io.Link>
259253
with ForwardingLink {
260254
MultiRootLink({
261-
required MultiRootFileSystem fileSystem,
262-
required io.Link delegate,
263-
}) : super(
264-
fileSystem: fileSystem,
265-
delegate: delegate,
266-
);
255+
required super.fileSystem,
256+
required super.delegate,
257+
});
267258

268259
@override
269260
String toString() =>

packages/flutter_tools/lib/src/base/os.dart

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,11 @@ abstract class OperatingSystemUtils {
166166

167167
class _PosixUtils extends OperatingSystemUtils {
168168
_PosixUtils({
169-
required FileSystem fileSystem,
170-
required Logger logger,
171-
required Platform platform,
172-
required ProcessManager processManager,
173-
}) : super._private(
174-
fileSystem: fileSystem,
175-
logger: logger,
176-
platform: platform,
177-
processManager: processManager,
178-
);
169+
required super.fileSystem,
170+
required super.logger,
171+
required super.platform,
172+
required super.processManager,
173+
}) : super._private();
179174

180175
@override
181176
void makeExecutable(File file) {
@@ -295,16 +290,11 @@ class _PosixUtils extends OperatingSystemUtils {
295290

296291
class _LinuxUtils extends _PosixUtils {
297292
_LinuxUtils({
298-
required FileSystem fileSystem,
299-
required Logger logger,
300-
required Platform platform,
301-
required ProcessManager processManager,
302-
}) : super(
303-
fileSystem: fileSystem,
304-
logger: logger,
305-
platform: platform,
306-
processManager: processManager,
307-
);
293+
required super.fileSystem,
294+
required super.logger,
295+
required super.platform,
296+
required super.processManager,
297+
});
308298

309299
String? _name;
310300

@@ -367,16 +357,11 @@ class _LinuxUtils extends _PosixUtils {
367357

368358
class _MacOSUtils extends _PosixUtils {
369359
_MacOSUtils({
370-
required FileSystem fileSystem,
371-
required Logger logger,
372-
required Platform platform,
373-
required ProcessManager processManager,
374-
}) : super(
375-
fileSystem: fileSystem,
376-
logger: logger,
377-
platform: platform,
378-
processManager: processManager,
379-
);
360+
required super.fileSystem,
361+
required super.logger,
362+
required super.platform,
363+
required super.processManager,
364+
});
380365

381366
String? _name;
382367

@@ -475,16 +460,11 @@ class _MacOSUtils extends _PosixUtils {
475460

476461
class _WindowsUtils extends OperatingSystemUtils {
477462
_WindowsUtils({
478-
required FileSystem fileSystem,
479-
required Logger logger,
480-
required Platform platform,
481-
required ProcessManager processManager,
482-
}) : super._private(
483-
fileSystem: fileSystem,
484-
logger: logger,
485-
platform: platform,
486-
processManager: processManager,
487-
);
463+
required super.fileSystem,
464+
required super.logger,
465+
required super.platform,
466+
required super.processManager,
467+
}) : super._private();
488468

489469
@override
490470
HostPlatform hostPlatform = HostPlatform.windows_x64;

packages/flutter_tools/lib/src/build_system/targets/linux.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class LinuxAotBundle extends Target {
193193
}
194194

195195
class DebugBundleLinuxAssets extends BundleLinuxAssets {
196-
const DebugBundleLinuxAssets(TargetPlatform targetPlatform) : super(targetPlatform);
196+
const DebugBundleLinuxAssets(super.targetPlatform);
197197

198198
@override
199199
String get name => 'debug_bundle_${getNameForTargetPlatform(targetPlatform)}_assets';
@@ -210,7 +210,7 @@ class DebugBundleLinuxAssets extends BundleLinuxAssets {
210210
}
211211

212212
class ProfileBundleLinuxAssets extends BundleLinuxAssets {
213-
const ProfileBundleLinuxAssets(TargetPlatform targetPlatform) : super(targetPlatform);
213+
const ProfileBundleLinuxAssets(super.targetPlatform);
214214

215215
@override
216216
String get name => 'profile_bundle_${getNameForTargetPlatform(targetPlatform)}_assets';
@@ -226,7 +226,7 @@ class ProfileBundleLinuxAssets extends BundleLinuxAssets {
226226
}
227227

228228
class ReleaseBundleLinuxAssets extends BundleLinuxAssets {
229-
const ReleaseBundleLinuxAssets(TargetPlatform targetPlatform) : super(targetPlatform);
229+
const ReleaseBundleLinuxAssets(super.targetPlatform);
230230

231231
@override
232232
String get name => 'release_bundle_${getNameForTargetPlatform(targetPlatform)}_assets';

packages/flutter_tools/lib/src/cmake_project.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class WindowsProject extends FlutterProjectPlatform implements CmakeBasedProject
8686

8787
/// The Windows UWP version of the Windows project.
8888
class WindowsUwpProject extends WindowsProject {
89-
WindowsUwpProject.fromFlutter(FlutterProject parent) : super.fromFlutter(parent);
89+
WindowsUwpProject.fromFlutter(super.parent) : super.fromFlutter();
9090

9191
@override
9292
String get _childDirectory => 'winuwp';

0 commit comments

Comments
 (0)