2

I want to develop a PoC application in Flutter for Mac/OS X as a desktop app (Flutter Framework supports Mac Desktop apps, but I'm trying to figure out a key piece regarding a binary executable.

Basically, I want to be able to execute an OS X executable from within a Flutter app. I'm aware of using method channels for platform specific code, but I'm not sure if this applies to running an executable on that platform or not.

How can I package a platform (OS X) binary with my Flutter app? How can I perform executions of an (OS X) executable from Flutter, and receive the "results" (probably stdout logging) ?

Any help is appreciated, thanks!

RoboBear
  • 5,434
  • 2
  • 33
  • 40
  • Are you talking about an *executable*, or a *library*? You say executable, but you've stressed that this is Go even though the language of that an executable was written in is irrelevant to running it, and method channels are the standard way of accessing platform libraries, not executables (Dart can run executables directly using `Process`). – smorgan Mar 25 '22 at 10:36
  • An executable. My thinking was that a Flutter app has to use the platform (via a method channel) to interact with the device, to run the executable. Are you saying I might be able to package the executable in the Flutter app and just run it via Dart `Process`? – RoboBear Mar 26 '22 at 00:20
  • I'm not sure what you mean by "use the platform". The Swift code in your application (which is the other end of a method channel) isn't "the platform", it's part of your application's code, just like the Dart code in your application. Neither has any more access to the rest of the system than the other, because they are part of the same process. They are just different languages. – smorgan Mar 27 '22 at 12:56

0 Answers0