apply upcoming rule use_collection_literals_when_possible (#8649)
This commit is contained in:
committed by
Ian Hickson
parent
906103dd10
commit
329e52c02c
@@ -330,7 +330,7 @@ class DevFS {
|
||||
final Set<String> assetPathsToEvict = new Set<String>();
|
||||
|
||||
final List<Future<Map<String, dynamic>>> _pendingOperations =
|
||||
new List<Future<Map<String, dynamic>>>();
|
||||
<Future<Map<String, dynamic>>>[];
|
||||
|
||||
Uri _baseUri;
|
||||
Uri get baseUri => _baseUri;
|
||||
@@ -376,7 +376,7 @@ class DevFS {
|
||||
// Handle deletions.
|
||||
printTrace('Scanning for deleted files');
|
||||
final String assetBuildDirPrefix = _asUriPath(getAssetBuildDirectory());
|
||||
final List<Uri> toRemove = new List<Uri>();
|
||||
final List<Uri> toRemove = <Uri>[];
|
||||
_entries.forEach((Uri deviceUri, DevFSContent content) {
|
||||
if (!content._exists) {
|
||||
final Future<Map<String, dynamic>> operation =
|
||||
|
||||
@@ -434,7 +434,7 @@ class _IOSDeviceLogReader extends DeviceLogReader {
|
||||
}
|
||||
|
||||
class _IOSDevicePortForwarder extends DevicePortForwarder {
|
||||
_IOSDevicePortForwarder(this.device) : _forwardedPorts = new List<ForwardedPort>();
|
||||
_IOSDevicePortForwarder(this.device) : _forwardedPorts = <ForwardedPort>[];
|
||||
|
||||
final IOSDevice device;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class HotRunner extends ResidentRunner {
|
||||
Uri _observatoryUri;
|
||||
|
||||
final bool benchmarkMode;
|
||||
final Map<String, int> benchmarkData = new Map<String, int>();
|
||||
final Map<String, int> benchmarkData = <String, int>{};
|
||||
// The initial launch is from a snapshot.
|
||||
bool _runningFromSnapshot = true;
|
||||
String kernelFilePath;
|
||||
@@ -141,7 +141,7 @@ class HotRunner extends ResidentRunner {
|
||||
return 1;
|
||||
}
|
||||
|
||||
final Map<String, dynamic> platformArgs = new Map<String, dynamic>();
|
||||
final Map<String, dynamic> platformArgs = <String, dynamic>{};
|
||||
|
||||
await startEchoingDeviceLog(package);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ const String _kCopyTemplateExtension = '.copy.tmpl';
|
||||
/// extensions.
|
||||
class Template {
|
||||
Template(Directory templateSource, Directory baseDir) {
|
||||
_templateFilePaths = new Map<String, String>();
|
||||
_templateFilePaths = <String, String>{};
|
||||
|
||||
if (!templateSource.existsSync()) {
|
||||
return;
|
||||
|
||||
@@ -505,14 +505,14 @@ class VM extends ServiceObjectOwner {
|
||||
_removeDeadIsolates(map['isolates']);
|
||||
}
|
||||
|
||||
final Map<String, ServiceObject> _cache = new Map<String,ServiceObject>();
|
||||
final Map<String,Isolate> _isolateCache = new Map<String,Isolate>();
|
||||
final Map<String, ServiceObject> _cache = <String,ServiceObject>{};
|
||||
final Map<String,Isolate> _isolateCache = <String,Isolate>{};
|
||||
|
||||
/// The list of live isolates, ordered by isolate start time.
|
||||
final List<Isolate> isolates = new List<Isolate>();
|
||||
final List<Isolate> isolates = <Isolate>[];
|
||||
|
||||
/// The set of live views.
|
||||
final Map<String, FlutterView> _viewCache = new Map<String, FlutterView>();
|
||||
final Map<String, FlutterView> _viewCache = <String, FlutterView>{};
|
||||
|
||||
int _compareIsolates(Isolate a, Isolate b) {
|
||||
final DateTime aStart = a.startTime;
|
||||
@@ -767,7 +767,7 @@ class Isolate extends ServiceObjectOwner {
|
||||
DateTime startTime;
|
||||
ServiceEvent pauseEvent;
|
||||
|
||||
final Map<String, ServiceObject> _cache = new Map<String, ServiceObject>();
|
||||
final Map<String, ServiceObject> _cache = <String, ServiceObject>{};
|
||||
|
||||
@override
|
||||
ServiceObject getFromMap(Map<String, dynamic> map) {
|
||||
@@ -967,7 +967,7 @@ class Isolate extends ServiceObjectOwner {
|
||||
class ServiceMap extends ServiceObject implements Map<String, dynamic> {
|
||||
ServiceMap._empty(ServiceObjectOwner owner) : super._empty(owner);
|
||||
|
||||
final Map<String, dynamic> _map = new Map<String, dynamic>();
|
||||
final Map<String, dynamic> _map = <String, dynamic>{};
|
||||
|
||||
@override
|
||||
void _update(Map<String, dynamic> map, bool mapIsRef) {
|
||||
|
||||
@@ -77,7 +77,7 @@ void applyMocksToCommand(FlutterCommand command) {
|
||||
|
||||
/// Common functionality for tracking mock interaction
|
||||
class BasicMock {
|
||||
final List<String> messages = new List<String>();
|
||||
final List<String> messages = <String>[];
|
||||
|
||||
void expectMessages(List<String> expectedMessages) {
|
||||
final List<String> actualMessages = new List<String>.from(messages);
|
||||
|
||||
Reference in New Issue
Block a user