Supposedly in C after importing <stdlibc.h> you can invoke method system() an pass a param to perform shutdown. But using this as C script passed to flutter button via ffi does not seem to work. There is a package stdlibc for flutter but it doesn't have the system() function. It has close() function but there isn't a good documentation on what fildes stand for what process. Maybe killing the main system process would also work but it's hard to determine what param to pass to perform that.
What would be the cleanest and safest way to shutdown and reboot linux machine programatically from a flutter app?