mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
When setting FlutterProjectArgs.command_line_argv prior to launching the engine, we were previously setting a placeholder value rather than the executable name. This resulted in Platform.executable (from dart:io) returning "placeholder" in application code. This updates the Windows implementation for consistency with macOS and guarantees that Platform.executable will return a reasonable value in Dart code. Note that this does not affect Platform.resolvedExecutable, which returns a full, resolved path, and is implemented in the Dart runtime itself. Previously the code: print(Platform.executable); print(Platform.resolvedExecutable); resulted in the following output on Windows: flutter: placeholder flutter: C:\path\to\project\build\windows\runner\Debug\project.exe after this patch, it results in: flutter: project.exe flutter: C:\path\to\project\build\windows\runner\Debug\project.exe Issue: https://github.com/flutter/flutter/issues/83921