1

I actually want to open installed AutoCad desktop application on the click of a button present in my flutter web application.

I searched for this on internet but couldn't find any answer.

1. Is there any way to open installed application on windows or mac from a flutter web on click of a button?

2. Is there any package available?

3. Do I need to right any native code?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Bilal Saeed
  • 2,092
  • 8
  • 31

1 Answers1

1

Get the path of the software like.. C:\Program Files\Autocad\... then use url_launcher to open the file on the click of the button.. but as per the documentation states, you should check if the file exists or not before opening it

Danny
  • 317
  • 4
  • 17
  • This didn't work for me unfortunately – Bilal Saeed Nov 01 '22 at 05:21
  • @BilalSaeed-FlutterDeveloper can you post snippets of your code, so that we can help? – Danny Nov 01 '22 at 12:49
  • [Click to see the snippet](https://drive.google.com/file/d/1xl-IdE0Jpp-tIcS5kjqPEa3V5gSqYbAv/view?usp=share_link) – Bilal Saeed Nov 01 '22 at 13:36
  • 1
    @BilalSaeed-FlutterDeveloper you are using a windows OS.. so the path is not correct.. you are using a forward slash.. while you should be using two backslashes.. it should be `C:\\Program Files\\NetBeans 8.1\\bin\\netbeans64.exe` you should use two backslashes to indicate its a path – Danny Nov 01 '22 at 15:58
  • const url = 'C:\\Program Files\\CCleaner\\CCleaner64.exe'; _launchURLnew(url); void _launchURLnew(String url) async { await launchUrl(Uri.file(url), mode: LaunchMode.externalApplication); just opens the folowing url http://192.168.1.5:8080/C%3A%5CProgram%20Files%5CCCleaner%5CCCleaner64.exe – Ivan Aug 04 '23 at 13:13