Make runner non-nullable as it always is. (#159156)

This commit is contained in:
Matan Lurey 2024-11-19 16:11:39 -08:00 committed by GitHub
parent 1686fa7eb4
commit 1fdcb757fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 9 deletions

View File

@ -372,7 +372,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
} on Exception catch (error) {
throwToolExit(error.toString());
}
result = await app.runner!.waitForAppToFinish();
result = await app.runner.waitForAppToFinish();
return;
}
while (true) {

View File

@ -902,7 +902,7 @@ class AppDomain extends Domain {
if (app == null) {
throw DaemonException("app '$appId' not found");
}
final FlutterDevice device = app.runner!.flutterDevices.first;
final FlutterDevice device = app.runner.flutterDevices.first;
final List<FlutterView> views = await device.vmService!.getFlutterViews();
final Map<String, Object?>? result = await device
.vmService!
@ -1550,20 +1550,24 @@ class NotifyingLogger extends DelegatingLogger {
/// A running application, started by this daemon.
class AppInstance {
AppInstance(this.id, { this.runner, this.logToStdout = false, required AppRunLogger logger })
: _logger = logger;
AppInstance(
this.id, {
required this.runner,
this.logToStdout = false,
required AppRunLogger logger,
}) : _logger = logger;
final String id;
final ResidentRunner? runner;
final ResidentRunner runner;
final bool logToStdout;
final AppRunLogger _logger;
Future<OperationResult> restart({ bool fullRestart = false, bool pause = false, String? reason }) {
return runner!.restart(fullRestart: fullRestart, pause: pause, reason: reason);
return runner.restart(fullRestart: fullRestart, pause: pause, reason: reason);
}
Future<void> stop() => runner!.exit();
Future<void> detach() => runner!.detach();
Future<void> stop() => runner.exit();
Future<void> detach() => runner.detach();
void closeLogger() {
_logger.close();

View File

@ -771,7 +771,7 @@ class RunCommand extends RunCommandBase {
throwToolExit(error.toString());
}
final DateTime appStartedTime = globals.systemClock.now();
final int result = await app.runner!.waitForAppToFinish();
final int result = await app.runner.waitForAppToFinish();
if (result != 0) {
throwToolExit(null, exitCode: result);
}