-
Notifications
You must be signed in to change notification settings - Fork 48
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
Feature Request: Configure only selected crop aspect ratio #20
Comments
onImageEditingComplete: (Uint8List bytes) async { does not return the edited image, can you tell me why? |
@rahatcse5bu Thank you for your feature request. In version 2.5.6, I have added a configuration option where you can specify which aspect ratio you want. Below is an example: configs: ProImageEditorConfigs(
cropRotateEditorConfigs: const CropRotateEditorConfigs(
initAspectRatio: CropAspectRatios.ratio3_4,
allowedAspectRatios: [
CropAspectRatios.custom,
CropAspectRatios.original,
CropAspectRatios.ratio1_1,
CropAspectRatios.ratio3_4,
CropAspectRatios.ratio9_16,
],
),
), By "control to change editing position" do you mean to order the AppBar and BottomBar differently? If yes, here you can see an example how to completely customize the AppBar and the same is also possible for the BottomBar with your own order and widgets. |
@MarcioPereira155 I would appreciate it if you would open a new thread here with your question. I can then help you to solve this problem. Please also post your code as you currently configure ProImageEditor. |
Lovely. for 2:3 and 3:2, will be like this: > cropRotateEditorConfigs: const CropRotateEditorConfigs(
], |
I see you want to use custom aspect ratios. I've changed the code in version configs: ProImageEditorConfigs(
cropRotateEditorConfigs: const CropRotateEditorConfigs(
initAspectRatio: 3.0 / 2.0,
aspectRatios: [
AspectRatioItem(text: '3*2', value: 3.0 / 2.0),
AspectRatioItem(text: '2*3', value: 2.0 / 3.0),
],
),
), In this case, all other aspect ratios are disabled and the user has only these two options. It is also possible to edit the TextEditor as shown in the picture. The easiest way to do this is to create your own TextEditor widget. Below is a guide on how to do this:
FlatIconTextButton(
label: Text('Text', style: bottomTextStyle),
icon: const Icon(
Icons.text_fields,
size: 22.0,
color: Colors.white,
),
onPressed: (){
// TODO: open your widget. After closing the editor push the new layer to the editor.
_editorKey.currentState.addLayer(layer);
},
),
``` |
Need such options to Configure/control only selected crop aspect ratio like only 16:9 or 4:3
I mean there needs have the control-availity to disable some aspect ratio.
Also need the control to change the editing options' position as wish
The text was updated successfully, but these errors were encountered: