9
9
import 'dart:async' ;
10
10
import 'dart:io' ;
11
11
12
+ import 'package:meta/meta.dart' ;
13
+
12
14
import 'build_spec.dart' ;
13
15
import 'util.dart' ;
14
16
@@ -20,7 +22,9 @@ void checkAndClearAppliedEditCommands() {
20
22
commands.addAll (editCommands);
21
23
commands.removeAll (appliedEditCommands);
22
24
separator ("UNUSED EditCommand" );
23
- commands.forEach ((cmd) => log (cmd.toString ()));
25
+ for (var cmd in commands) {
26
+ log (cmd.toString ());
27
+ }
24
28
}
25
29
appliedEditCommands.clear ();
26
30
}
@@ -125,10 +129,9 @@ class EditAndroidModuleLibraryManager extends EditCommand {
125
129
// Starting with 3.6 we need to call a simplified init().
126
130
// This is where the $PROJECT_FILE$ macro is defined, #registerComponents.
127
131
if (spec.version.startsWith ('4.2' )) {
128
- var processedFile, source;
129
- processedFile = File (
132
+ var processedFile = File (
130
133
'flutter-studio/src/io/flutter/android/AndroidModuleLibraryManager.java' );
131
- source = processedFile.readAsStringSync ();
134
+ var source = processedFile.readAsStringSync ();
132
135
var original = source;
133
136
source = source.replaceAll ("ProjectExImpl" , "ProjectImpl" );
134
137
source = source.replaceAll (
@@ -170,7 +173,7 @@ Future<int> applyEdits(BuildSpec spec, Function compileFn) async {
170
173
if (entity is File ) {
171
174
var stubFile = File ('${file }_stub' );
172
175
if (stubFile.existsSync ()) {
173
- await stubFile.copy ('$ file ' );
176
+ await stubFile.copy (file);
174
177
log ('copied ${file }_stub' );
175
178
}
176
179
}
@@ -179,13 +182,13 @@ Future<int> applyEdits(BuildSpec spec, Function compileFn) async {
179
182
180
183
var edited = < EditCommand , String > {};
181
184
try {
182
- editCommands. forEach (( edit) {
185
+ for ( var edit in editCommands ) {
183
186
var source = edit.convert (spec);
184
187
if (source != null ) {
185
188
edited[edit] = source;
186
189
appliedEditCommands.add (edit);
187
190
}
188
- });
191
+ }
189
192
190
193
return await compileFn.call ();
191
194
} finally {
@@ -231,9 +234,9 @@ class Subst extends EditCommand {
231
234
232
235
Subst (
233
236
{this .versions,
234
- this .initial,
235
- this .replacement,
236
- this .path,
237
+ @required this .initial,
238
+ @required this .replacement,
239
+ @required this .path,
237
240
String version})
238
241
: assert (initial != null ),
239
242
assert (replacement != null ),
@@ -260,6 +263,7 @@ class Subst extends EditCommand {
260
263
}
261
264
}
262
265
266
+ @override
263
267
String toString () => "Subst(path: $path , versions: $versions )" ;
264
268
265
269
bool versionMatches (BuildSpec spec) {
@@ -279,7 +283,7 @@ class MultiSubst extends EditCommand {
279
283
this .versions,
280
284
this .initials,
281
285
this .replacements,
282
- this .path,
286
+ @required this .path,
283
287
}) {
284
288
assert (initials.length == replacements.length);
285
289
assert (path != null );
@@ -303,6 +307,7 @@ class MultiSubst extends EditCommand {
303
307
}
304
308
}
305
309
310
+ @override
306
311
String toString () => "Subst(path: $path , versions: $versions )" ;
307
312
308
313
bool versionMatches (BuildSpec spec) {
0 commit comments