Giter VIP home page Giter VIP logo

Comments (4)

hbali avatar hbali commented on August 28, 2024 2

@Miedziaq
Hi!

You need another library to access the path (flutter_absolute_path package).

I did it like this:

final images = await MultiImagePicker.pickImages(
        maxImages: 4,
        enableCamera: true);

    final files = List<File>();
    await Future.wait(images.map((e) async {
      final path = await FlutterAbsolutePath.getAbsolutePath(e.identifier);
      final file = File(path);
      files.add(file);
    }));
    return files;

from multi_image_picker2.

MRSEREY avatar MRSEREY commented on August 28, 2024

@Miedziaq is there any ways to convert File to Asset?

from multi_image_picker2.

hbrhbr avatar hbrhbr commented on August 28, 2024

@Miedziaq Hi!

You need another library to access the path (flutter_absolute_path package).

I did it like this:

final images = await MultiImagePicker.pickImages(
        maxImages: 4,
        enableCamera: true);

    final files = List<File>();
    await Future.wait(images.map((e) async {
      final path = await FlutterAbsolutePath.getAbsolutePath(e.identifier);
      final file = File(path);
      files.add(file);
    }));
    return files;

But this package don't support null-safety.

from multi_image_picker2.

Miedziaq avatar Miedziaq commented on August 28, 2024

@Miedziaq is there any ways to convert File to Asset?

unfortunately i dont find any proper way to done it. only flutter_absolute_path like @hbrhbr mentioned but if you have newer project it not works. and i cannot solve my problem with this. another way is to save selected files to temp folder to have access to it and path then, but everything is to done manually by yourself..

finally i resign completely from this library and i switched to the other one without this problems :)

from multi_image_picker2.

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.