Make FlutterDevice.generator final (#21555)

Now that Dart 1 support has been eliminated, generator should always be
populated to a kernel compiler instance.

Also moves the constructor to the top of the class, and orders final
fields before non-final fields, as dictated by the style guide.
This commit is contained in:
Chris Bracken 2018-09-07 13:56:04 -07:00 committed by GitHub
parent 5ab9e70727
commit 05d557b9ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,32 +29,28 @@ import 'run_hot.dart';
import 'vmservice.dart';
class FlutterDevice {
final Device device;
List<Uri> observatoryUris;
List<VMService> vmServices;
DevFS devFS;
ApplicationPackage package;
ResidentCompiler generator;
String dillOutputPath;
List<String> fileSystemRoots;
String fileSystemScheme;
StreamSubscription<String> _loggingSubscription;
FlutterDevice(this.device, {
@required bool trackWidgetCreation,
this.dillOutputPath,
this.fileSystemRoots,
this.fileSystemScheme,
ResidentCompiler generator,
}) {
this.generator = generator ?? new ResidentCompiler(
}) : this.generator = generator ?? new ResidentCompiler(
artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath),
trackWidgetCreation: trackWidgetCreation,
fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme
);
}
final Device device;
final ResidentCompiler generator;
List<Uri> observatoryUris;
List<VMService> vmServices;
DevFS devFS;
ApplicationPackage package;
String dillOutputPath;
List<String> fileSystemRoots;
String fileSystemScheme;
StreamSubscription<String> _loggingSubscription;
String viewFilter;
/// If the [reloadSources] parameter is not null the 'reloadSources' service