fix upcoming lint avoid_returning_null_for_void (#23190)
This commit is contained in:
parent
cab7ecb8e5
commit
8b0de38ef8
@ -44,7 +44,7 @@ Future<void> runCommand(String executable, List<String> arguments, {
|
||||
final String relativeWorkingDir = path.relative(workingDirectory);
|
||||
if (skip) {
|
||||
printProgress('SKIPPING', relativeWorkingDir, commandDescription);
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
printProgress('RUNNING', relativeWorkingDir, commandDescription);
|
||||
|
||||
|
@ -28,7 +28,7 @@ Future<void> main(List<String> rawArgs) async {
|
||||
stderr.writeln('Usage:\n');
|
||||
stderr.writeln(_argParser.usage);
|
||||
exitCode = 1;
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!args.wasParsed('task')) {
|
||||
@ -50,7 +50,7 @@ Future<void> main(List<String> rawArgs) async {
|
||||
if (_taskNames.isEmpty) {
|
||||
stderr.writeln('Failed to find tasks to run based on supplied options.');
|
||||
exitCode = 1;
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
final bool silent = args['silent'];
|
||||
|
@ -407,7 +407,6 @@ class IosDeviceDiscovery implements DeviceDiscovery {
|
||||
@override
|
||||
Future<void> performPreflightTasks() async {
|
||||
// Currently we do not have preflight tasks for iOS.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ class UpdaterState extends State<Updater> {
|
||||
// Only prompt once a day
|
||||
if (_lastUpdateCheck != null &&
|
||||
DateTime.now().difference(_lastUpdateCheck) < const Duration(days: 1)) {
|
||||
return null; // We already checked for updates recently
|
||||
return; // We already checked for updates recently
|
||||
}
|
||||
_lastUpdateCheck = DateTime.now();
|
||||
|
||||
|
@ -931,7 +931,7 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager {
|
||||
@override
|
||||
void createChild(int index, { @required RenderBox after }) {
|
||||
if (index < 0 || index >= children.length)
|
||||
return null;
|
||||
return;
|
||||
try {
|
||||
_currentlyUpdatingChildIndex = index;
|
||||
_renderObject.insert(children[index], after: after);
|
||||
|
@ -27,7 +27,7 @@ class TestRenderSliverBoxChildManager extends RenderSliverBoxChildManager {
|
||||
@override
|
||||
void createChild(int index, { @required RenderBox after }) {
|
||||
if (index < 0 || index >= children.length)
|
||||
return null;
|
||||
return;
|
||||
try {
|
||||
_currentlyUpdatingChildIndex = index;
|
||||
_renderObject.insert(children[index], after: after);
|
||||
|
@ -568,7 +568,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
|
||||
|
||||
assert(inTest);
|
||||
asyncBarrier(); // When using AutomatedTestWidgetsFlutterBinding, this flushes the microtasks.
|
||||
return null;
|
||||
}
|
||||
|
||||
void _verifyInvariants() {
|
||||
|
@ -40,7 +40,6 @@ Future<void> writeFile(libfs.File outputFile, DevFSContent content) async {
|
||||
outputFile.createSync(recursive: true);
|
||||
final List<int> data = await content.contentsAsBytes();
|
||||
outputFile.writeAsBytesSync(data);
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<void> run(List<String> args) async {
|
||||
|
@ -72,7 +72,7 @@ class Cache {
|
||||
/// calling [Cache.releaseLockEarly] once they are no longer touching the cache.
|
||||
static Future<void> lock() async {
|
||||
if (!_lockEnabled)
|
||||
return null;
|
||||
return;
|
||||
assert(_lock == null);
|
||||
_lock = await fs.file(fs.path.join(flutterRoot, 'bin', 'cache', 'lockfile')).open(mode: FileMode.write);
|
||||
bool locked = false;
|
||||
@ -201,7 +201,7 @@ class Cache {
|
||||
|
||||
Future<void> updateAll() async {
|
||||
if (!_lockEnabled)
|
||||
return null;
|
||||
return;
|
||||
try {
|
||||
for (CachedArtifact artifact in _artifacts) {
|
||||
if (!artifact.isUpToDate())
|
||||
|
@ -87,7 +87,7 @@ class CrashReportSender {
|
||||
}) async {
|
||||
try {
|
||||
if (_usage.suppressAnalytics)
|
||||
return null;
|
||||
return;
|
||||
|
||||
printStatus('Sending crash report to Google.');
|
||||
|
||||
|
@ -579,7 +579,7 @@ class _IOSDevicePortForwarder extends DevicePortForwarder {
|
||||
Future<void> unforward(ForwardedPort forwardedPort) async {
|
||||
if (!_forwardedPorts.remove(forwardedPort)) {
|
||||
// Not in list. Nothing to remove.
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
printTrace('Unforwarding port $forwardedPort');
|
||||
@ -591,7 +591,5 @@ class _IOSDevicePortForwarder extends DevicePortForwarder {
|
||||
} else {
|
||||
printError('Forwarded port did not have a valid process');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ class ColdRunner extends ResidentRunner {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> handleTerminalCommand(String code) async => null;
|
||||
Future<void> handleTerminalCommand(String code) async { }
|
||||
|
||||
@override
|
||||
Future<void> cleanupAfterSignal() async {
|
||||
|
@ -278,10 +278,10 @@ class MemoryIOSink implements IOSink {
|
||||
Future<void> get done => close();
|
||||
|
||||
@override
|
||||
Future<void> close() async => null;
|
||||
Future<void> close() async { }
|
||||
|
||||
@override
|
||||
Future<void> flush() async => null;
|
||||
Future<void> flush() async { }
|
||||
}
|
||||
|
||||
/// A Stdio that collects stdout and supports simulated stdin.
|
||||
|
Loading…
x
Reference in New Issue
Block a user