@@ -79,22 +79,22 @@ class _CoverageMetrics {
7979 String ? excludeFromCoverage,
8080 ) {
8181 final glob = excludeFromCoverage != null ? Glob (excludeFromCoverage) : null ;
82- return records.fold <_CoverageMetrics >(
83- const _CoverageMetrics ._() ,
84- (current, record) {
85- final found = record.lines ? .found ?? 0 ;
86- final hit = record.lines? .hit ?? 0 ;
87- if (glob != null && record.file != null ) {
88- if (glob. matches ( record.file! ) ) {
89- return current;
90- }
82+ return records.fold <_CoverageMetrics >(const _CoverageMetrics ._(), (
83+ current ,
84+ record,
85+ ) {
86+ final found = record.lines? .found ?? 0 ;
87+ final hit = record.lines ? .hit ?? 0 ;
88+ if (glob != null && record.file != null ) {
89+ if (glob. matches (record.file ! )) {
90+ return current;
9191 }
92- return _CoverageMetrics ._(
93- totalFound : current.totalFound + found,
94- totalHits : current.totalHits + hit ,
95- );
96- },
97- );
92+ }
93+ return _CoverageMetrics ._(
94+ totalFound : current.totalFound + found ,
95+ totalHits : current.totalHits + hit,
96+ );
97+ } );
9898 }
9999
100100 final int totalHits;
@@ -119,9 +119,7 @@ typedef GeneratorBuilder = Future<MasonGenerator> Function(MasonBundle);
119119/// Flutter CLI
120120class Flutter {
121121 /// Determine whether flutter is installed.
122- static Future <bool > installed ({
123- required Logger logger,
124- }) async {
122+ static Future <bool > installed ({required Logger logger}) async {
125123 try {
126124 await _Cmd .run ('flutter' , ['--version' ], logger: logger);
127125 return true ;
@@ -213,14 +211,10 @@ class Flutter {
213211 ? '.'
214212 : '.${p .context .separator }$relativePath ' ;
215213
216- stdout? .call (
217- 'Running "flutter test" in $path ...\n ' ,
218- );
214+ stdout? .call ('Running "flutter test" in $path ...\n ' );
219215
220216 if (! Directory (p.join (target.dir.absolute.path, 'test' )).existsSync ()) {
221- stdout? .call (
222- 'No test folder found in $path \n ' ,
223- );
217+ stdout? .call ('No test folder found in $path \n ' );
224218 return ExitCode .success.code;
225219 }
226220
@@ -333,10 +327,7 @@ Future<void> _verifyGitDependencies(
333327
334328 await Future .wait (
335329 gitDependencies.map (
336- (dependency) => Git .reachable (
337- dependency.url,
338- logger: logger,
339- ),
330+ (dependency) => Git .reachable (dependency.url, logger: logger),
340331 ),
341332 );
342333}
@@ -408,13 +399,11 @@ Future<int> _flutterTest({
408399 Stream .periodic (
409400 const Duration (seconds: 1 ),
410401 (computationCount) => computationCount,
411- ).listen (
412- (tick) {
413- if (completer.isCompleted) return ;
414- final timeElapsed = Duration (seconds: tick).formatted ();
415- stdout ('$clearLine $timeElapsed ...' );
416- },
417- );
402+ ).listen ((tick) {
403+ if (completer.isCompleted) return ;
404+ final timeElapsed = Duration (seconds: tick).formatted ();
405+ stdout ('$clearLine $timeElapsed ...' );
406+ });
418407
419408 late final StreamSubscription <TestEvent > subscription;
420409 late final StreamSubscription <ProcessSignal > sigintWatchSubscription;
@@ -429,10 +418,7 @@ Future<int> _flutterTest({
429418 subscription =
430419 testRunner (
431420 workingDirectory: cwd,
432- arguments: [
433- if (collectCoverage) '--coverage' ,
434- ...? arguments,
435- ],
421+ arguments: [if (collectCoverage) '--coverage' , ...? arguments],
436422 runInShell: true ,
437423 ).listen (
438424 (event) {
@@ -586,9 +572,8 @@ String? _topGroupName(Test test, Map<int, TestGroup> groups) => test.groupIDs
586572 .map ((groupID) => groups[groupID]? .name)
587573 .firstWhereOrNull ((groupName) => groupName? .isNotEmpty ?? false );
588574
589- Future <void > _cleanupOptimizerFile (String cwd) async => File (
590- p.join (cwd, 'test' , _testOptimizerFileName),
591- ).delete ().ignore ();
575+ Future <void > _cleanupOptimizerFile (String cwd) async =>
576+ File (p.join (cwd, 'test' , _testOptimizerFileName)).delete ().ignore ();
592577
593578final int _lineLength = () {
594579 try {
0 commit comments