After building the Dart application, function Process.run starts to open a visible cmd for a second-two.
final bool checkEnvironment = environment == ShellEnvironment.powershell;
ProcessResult result = await Process.run(
checkEnvironment ? 'powershell' : command,
checkEnvironment ? [command] : args,
runInShell: checkEnvironment,
);
Link with example(gif): https://i.stack.imgur.com/orSzG.jpg For each command it opens a new cmd window.
If i launch the application with idea(not a build version) - such thing does not happen
Also tried this version - still the same problem:
final bool checkEnvironment = environment == ShellEnvironment.powershell;
ProcessResult result = await Process.run(
'start',
checkEnvironment ? ['/min', 'powershell', '-command', command] : ['/min', 'cmd', '/c', command],
runInShell: true,
);
Found an article that runInShell creates a new window so i removed it, but the result is still the same.
final bool checkEnvironment = environment == ShellEnvironment.powershell;
ProcessResult result = await Process.run(
checkEnvironment ? 'powershell.exe' : 'cmd',
checkEnvironment ? ['-command', command] : ['/c', command],
);