How to select multiple images at a time in Mobile
My issue is about [Mobile]
typedef OnImagePickCallback = Future<String?> Function(File file);
QuillToolbar.basic( color: darkTheme == true ? Colors.black : Colors.white, controller: _controller, embedButtons: FlutterQuillEmbeds.buttons( onImagePickCallback: _onImagePickCallback), ),
By default, I can only select one image at a time, but how to select multiple images in Flutter quill ^7.1.4
Future<String?> _onImagePickCallback(File file) async { if (file == null) return null; // Copies the picked file from temporary cache to applications directory Directory appDocDir = await getApplicationDocumentsDirectory();
int sizeInBytes = file.lengthSync();
double sizeInMb = sizeInBytes / (1024 * 1024);
print(sizeInMb);
if (sizeInMb > 0.25) {
file = (await FlutterImageCompress.compressAndGetFile(
file.absolute.path, '${appDocDir.path}/${basename(file.path)}',
quality: 20))!;
print(file.lengthSync());
} else {
file = await file.copy('${appDocDir.path}/${basename(file.path)}');
}
print(file.path);
return file.path.toString();
}
Sorry but the flutter_quill_extensions image embed builder doesn't support selecting multiple images yet but we will look into that in the future
Is there any other way I can achieve it in code?
Is there any other way I can achieve it in code?
As far as I know, you will need custom image embed builder
how to make that one ? any example or reference or a small description to achieve that.
how to make that one ? any example or reference or a small description to achieve that.
You need to create a custom embed builder in order to achieve that
You will find it in the README.md
and to use it pass the embed builder in the QuillEditor configurations