Comments (4)
@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.
@Miedziaq is there any ways to convert File to Asset?
from multi_image_picker2.
@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 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)
- Camera option not working in any version. HOT 3
- multi_image_picker2 插件里面依赖的 com.sangcomz.fishbun 0.11.2 里面报空指针了
- album selector for ios ? HOT 5
- Image Select from Camera Is not working in some android device.
- Image Metadata is not returned due to a cast exception HOT 1
- Open Camera separated
- Permission denied on Android HOT 1
- Can the Cancel button customize text like the confirm button?
- Need documentation about permissions. HOT 2
- Encounter an error when calling metadata HOT 1
- enableCamera not worked on iOS HOT 9
- Documentation not working 404
- Apps force close when button picker pressed HOT 1
- getThumbByteData give image with bad height
- Unable to see camera option in multi_image_picker2: ^5.0.2
- upgrading guide 404
- jcenter on android
- Android - Image picker is already active
- Example app does not build for android
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multi_image_picker2.