Giter Club home page Giter Club logo

Comments (9)

crazecoder avatar crazecoder commented on May 18, 2024 1

@Zeeshan0201 #48

from open_file.

crazecoder avatar crazecoder commented on May 18, 2024

I've tried it and it's ok, this is my code

    Directory tempDir = await getExternalStorageDirectory();
    String filePath = "${tempDir.path}/flutter-dilidili.apk";
    if(File(filePath).existsSync()){
        File(filePath).deleteSync();
    }
    Dio dio = new Dio();
    Response response = await dio.download("https://raw.githubusercontent.com/crazecoder/dilidili/master/apk/flutter-dilidili.apk", filePath,onReceiveProgress:(_c,_t){
      print(_c/_t*100);
    },);
    final message = await OpenFile.open(filePath);

from open_file.

liepaja avatar liepaja commented on May 18, 2024

can you also add image_picker? That way we can see if it is the FileProvider. Without the image_picker it works for me as well.

from open_file.

crazecoder avatar crazecoder commented on May 18, 2024

It still works

    Directory tempDir = await getExternalStorageDirectory();
    String filePath = "${tempDir.path}/screen.png";
    print(filePath);
    if (File(filePath).existsSync()) {
      File(filePath).deleteSync();
    }
    Dio dio = new Dio();
    Response response = await dio.download(
      "https://raw.githubusercontent.com/crazecoder/dilidili/master/screenshot/screen.png",
      filePath,
      onReceiveProgress: (_c, _t) {
        print(_c / _t * 100);
      },
    );
    var image = await ImagePicker.pickImage(source: ImageSource.gallery);

    filePath = image.path;
    print(filePath);
    final message = await OpenFile.open(filePath);

from open_file.

liepaja avatar liepaja commented on May 18, 2024

Actually i deleted imagepicker. still same issue will look deeper where it comes from. Mby permission issue. Can you print your filePath?

from open_file.

crazecoder avatar crazecoder commented on May 18, 2024

save path

I/flutter ( 7594): /storage/emulated/0/Android/data/com.crazecoder.openfileexample/files/screen.png

open path

I/flutter ( 7594): /storage/emulated/0/Android/data/com.crazecoder.openfileexample/files/Pictures/scaled_screen.png

I chose the path "/storage/emulated/0/Android/data/com.crazecoder.openfileexample/files/screen.png", but the printed path is not, I'm not sure about the mechanism of image_picker

from open_file.

Zeeshan0201 avatar Zeeshan0201 commented on May 18, 2024

I've tried it and it's ok, this is my code

    Directory tempDir = await getExternalStorageDirectory();
    String filePath = "${tempDir.path}/flutter-dilidili.apk";
    if(File(filePath).existsSync()){
        File(filePath).deleteSync();
    }
    Dio dio = new Dio();
    Response response = await dio.download("https://raw.githubusercontent.com/crazecoder/dilidili/master/apk/flutter-dilidili.apk", filePath,onReceiveProgress:(_c,_t){
      print(_c/_t*100);
    },);
    final message = await OpenFile.open(filePath);

@crazecoder getting this error after implementing above method in dio download..
**MissingPluginException(No implementation found for method open_file on channel open_file)
Screenshot from 2019-08-01 12-02-56
**

from open_file.

Zeeshan0201 avatar Zeeshan0201 commented on May 18, 2024

@crazecoder yes it's worked for me! thanks for your quick response 👍

from open_file.

liepaja avatar liepaja commented on May 18, 2024

Hmm, had to reinstall my ubunut, hence new flutter and vscode. Now it works for some reason .Thanks for support

from open_file.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.