Skip to content

Commit 1fdcb75

Browse files
authored
Make runner non-nullable as it always is. (#159156)
1 parent 1686fa7 commit 1fdcb75

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

packages/flutter_tools/lib/src/commands/attach.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ known, it can be explicitly provided to attach via the command-line, e.g.
372372
} on Exception catch (error) {
373373
throwToolExit(error.toString());
374374
}
375-
result = await app.runner!.waitForAppToFinish();
375+
result = await app.runner.waitForAppToFinish();
376376
return;
377377
}
378378
while (true) {

packages/flutter_tools/lib/src/commands/daemon.dart

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ class AppDomain extends Domain {
902902
if (app == null) {
903903
throw DaemonException("app '$appId' not found");
904904
}
905-
final FlutterDevice device = app.runner!.flutterDevices.first;
905+
final FlutterDevice device = app.runner.flutterDevices.first;
906906
final List<FlutterView> views = await device.vmService!.getFlutterViews();
907907
final Map<String, Object?>? result = await device
908908
.vmService!
@@ -1550,20 +1550,24 @@ class NotifyingLogger extends DelegatingLogger {
15501550

15511551
/// A running application, started by this daemon.
15521552
class AppInstance {
1553-
AppInstance(this.id, { this.runner, this.logToStdout = false, required AppRunLogger logger })
1554-
: _logger = logger;
1553+
AppInstance(
1554+
this.id, {
1555+
required this.runner,
1556+
this.logToStdout = false,
1557+
required AppRunLogger logger,
1558+
}) : _logger = logger;
15551559

15561560
final String id;
1557-
final ResidentRunner? runner;
1561+
final ResidentRunner runner;
15581562
final bool logToStdout;
15591563
final AppRunLogger _logger;
15601564

15611565
Future<OperationResult> restart({ bool fullRestart = false, bool pause = false, String? reason }) {
1562-
return runner!.restart(fullRestart: fullRestart, pause: pause, reason: reason);
1566+
return runner.restart(fullRestart: fullRestart, pause: pause, reason: reason);
15631567
}
15641568

1565-
Future<void> stop() => runner!.exit();
1566-
Future<void> detach() => runner!.detach();
1569+
Future<void> stop() => runner.exit();
1570+
Future<void> detach() => runner.detach();
15671571

15681572
void closeLogger() {
15691573
_logger.close();

packages/flutter_tools/lib/src/commands/run.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ class RunCommand extends RunCommandBase {
771771
throwToolExit(error.toString());
772772
}
773773
final DateTime appStartedTime = globals.systemClock.now();
774-
final int result = await app.runner!.waitForAppToFinish();
774+
final int result = await app.runner.waitForAppToFinish();
775775
if (result != 0) {
776776
throwToolExit(null, exitCode: result);
777777
}

0 commit comments

Comments
 (0)