Flutter desktop / go-flutter-desktop Open Excel File on Windows Platform

前端 未结 1 920
醉梦人生
醉梦人生 2021-01-28 07:28

For running Flutter on Windows platform and I do this with go-flutter-desktop.
I need to open Excel file while click button.
After long struggling, I would like to sh

相关标签:
1条回答
  • 2021-01-28 08:11
    import 'dart:io';
    ...
    onTap: () {
    
                        String win10Path =
                            'C:\\progra~1\\MIF5BA~1\\Office16\\EXCEL.EXE';
                        String win7Path =
                            'C:\\progra~2\\micros~1\\Office14\\EXCEL.EXE';
                        //'C:\\progra~1\\MIF5BA~1\\Office16\\EXCEL.EXE'
                        try {
                          print('process start');
                          Process.run(win7Path, ['C:\\test.xlsx'])
                              .then((ProcessResult results) {
                            print(results.stdout);
                          });
                        } catch (e) {
                          print(e);
                        }
                      }
    

    0 讨论(0)
提交回复
热议问题