if chains → switch expressions (#147793)
Previous "if-chains" pull requests: - https://github.com/flutter/flutter/pull/144905 - https://github.com/flutter/flutter/pull/144977 - https://github.com/flutter/flutter/pull/145194 - https://github.com/flutter/flutter/pull/146293 - https://github.com/flutter/flutter/pull/147472 <br> I think this one should be enough to wrap things up! fixes https://github.com/flutter/flutter/issues/144903 --------- Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This commit is contained in:
@@ -131,12 +131,11 @@ abstract class DeferredComponentsValidator {
|
||||
if (line.startsWith('Only in android')) {
|
||||
continue;
|
||||
}
|
||||
TerminalColor color = TerminalColor.grey;
|
||||
if (line.startsWith('+')) {
|
||||
color = TerminalColor.green;
|
||||
} else if (line.startsWith('-')) {
|
||||
color = TerminalColor.red;
|
||||
}
|
||||
final TerminalColor color = switch (line[0]) {
|
||||
'+' => TerminalColor.green,
|
||||
'-' => TerminalColor.red,
|
||||
_ => TerminalColor.grey,
|
||||
};
|
||||
logger.printStatus(line, color: color);
|
||||
}
|
||||
logger.printStatus('');
|
||||
|
||||
Reference in New Issue
Block a user