I am creating a Flutter Desktop application for windows and I am trying to retrieve the application directory where the exe is located. I tried to use path_provider but can only get the Documents directory. Any help I would appreciate lots.
Use Platform.resolvedExecutable
(of dart:io).
I have tested it in Flutter/Windows and it works.
Strangely, Platform.executable returns null instead. I tell strangely because its type is String not nullable. This unexpected null value can cause crash or errors that are difficult to detect (but in the end Flutter desktop is not in the stable channel).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With