runFlutterRun function
flutter run
Implementation
Future<void> runFlutterRun(
String project,
void Function(Process process) onProcessStarted,
void Function() onMaybeLaunched,
) async {
final process = await runFlutter(
project,
const [
'run',
'-d',
'chrome',
],
onStdout: (msg) {
final startWithKeyword = msg.startsWith(_appLaunchedKeyword);
if (startWithKeyword) {
onMaybeLaunched();
}
stdout.write(msg);
},
onStderr: (msg) {
stdout.write(msg);
},
);
onProcessStarted(process);
await process.exitCode;
}