-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] How can I pick images from gallery directly? #97
Comments
Yes you can do this: HtmlEditor(
controller: controller,
htmlToolbarOptions: HtmlToolbarOptions(
onButtonPressed: (ButtonType type, bool? status,
Function()? updateStatus) {
if (type == ButtonType.picture) {
showDialog(); //show your custom dialog here or directly open image picker
return false; //this tells the plugin we handled image in a custom way
}
return true; //this tells the plugin to handle everything else as normal
},
),
), and in the dialog complete method //upload base64 data here
controller.insertNetworkImage(url); //to insert via URL
controller.insertHtml("<img src='data:image/$extension;base64,$base64Data'/>"); //to insert base64 Hope it helps! If it doesn't work or you have any other questions let me know. |
String base64Data = base64.encode(file.bytes!); above code to resize image into 100% in base 64 . is there any way to resize image on insertNetworkImage using custom html tags? |
Yes, just make |
That's how I wrote it.
...
|
Hi,
In my app, my users do not have chance to input url for images and I am wondering whether I can remove this window.
My questions:
Is it possible to remove this window without modifying original code of the library? One way I thought was I should define two custom bottoms for image upload and video upload, but after that, how can I pass the images link or base64 data to controller and insert into editor because I can not use mediaUploadInterceptor?
thanks for help!
The text was updated successfully, but these errors were encountered: