From 05d557b9ef92d99acc1b3395a2fa2b9c274f31a8 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 7 Sep 2018 13:56:04 -0700 Subject: [PATCH] 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. --- .../lib/src/resident_runner.dart | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 277ede188e..d675e6db37 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -29,32 +29,28 @@ import 'run_hot.dart'; import 'vmservice.dart'; class FlutterDevice { - final Device device; - List observatoryUris; - List vmServices; - DevFS devFS; - ApplicationPackage package; - ResidentCompiler generator; - String dillOutputPath; - List fileSystemRoots; - String fileSystemScheme; - - StreamSubscription _loggingSubscription; - FlutterDevice(this.device, { @required bool trackWidgetCreation, this.dillOutputPath, this.fileSystemRoots, this.fileSystemScheme, ResidentCompiler generator, - }) { - this.generator = generator ?? new ResidentCompiler( - artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath), - trackWidgetCreation: trackWidgetCreation, - fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme - ); - } + }) : this.generator = generator ?? new ResidentCompiler( + artifacts.getArtifactPath(Artifact.flutterPatchedSdkPath), + trackWidgetCreation: trackWidgetCreation, + fileSystemRoots: fileSystemRoots, fileSystemScheme: fileSystemScheme + ); + final Device device; + final ResidentCompiler generator; + List observatoryUris; + List vmServices; + DevFS devFS; + ApplicationPackage package; + String dillOutputPath; + List fileSystemRoots; + String fileSystemScheme; + StreamSubscription _loggingSubscription; String viewFilter; /// If the [reloadSources] parameter is not null the 'reloadSources' service