Comments (11)
Does it return null or an empty image?
Do you wait for it to be loaded or crop while loading?
Have you tried running the example?
from flutter-custom-image-crop.
Yes I have tried with your example, but I found one scenario in which the onCropImage is not working. If I am picking the image from image_picker and set the Uint8List value to the CustomImageCrop widget, then this is not working. because the controller is not updated to the newly added image.
Could you please suggest a solution for updating the controller on selecting the image dynamically?
from flutter-custom-image-crop.
Ah, that is correct. We should add a didUpdateWidget(oldWidget)
method where we can then update the controller.
Feel free to create a PR for this! (I can maybe fix it somewhere this week, but it might take a few days).
from flutter-custom-image-crop.
Is it fine to call the _getImage method under the didUpdateWidget function?
from flutter-custom-image-crop.
You can definetly try adding this and seeing if this fixed the issue.
That is what we're doing in the didChangeDependencies
as well. Can you share a piece of your code where you load the image?
from flutter-custom-image-crop.
By this was I am loading my image into the CustomImageCrop
Consumer<changeNotifier>(
builder: (context, viewModel, child) {
return Container(
height: MediaQuery.of(context).size.height / 2,
width: MediaQuery.of(context).size.width / 2,
child: CustomImageCrop(
cropController: viewModel.cropController,
shape: CustomCropShape.Square,
imageFit: CustomImageFit.fitVisibleSpace,
image: MemoryImage(
viewModel.binaryImage ?? viewModel.profileImage!),
),
);
}),
Also while picking the image I am updating the binary image as
binaryImage = (await viewModel.cropController.onCropImage())?.bytes;
Could you please fix this ASAP, I am stuck with my implementation for this.
from flutter-custom-image-crop.
@ikbendewilliam I have tested it by implementing the didUpdateWidget it was working fine. Can you please fix the same in your plugin?
from flutter-custom-image-crop.
@umamaheswari2023 I've created a PR for this #41, can you double check that this fixes your issue? You can use it by adding this to your pubspec.yaml
dependency_overrides:
custom_image_crop:
git:
url: https://github.com/icapps/flutter-custom-image-crop
ref: 7a04a982f4b565c08870c844399398d5e04aacb0
from flutter-custom-image-crop.
Hi @ikbendewilliam This PR fixed my issue. Can you please merge this PR, So that I can use the stable version.
from flutter-custom-image-crop.
Perfect, yes I'll merge and release asap
from flutter-custom-image-crop.
Released as 0.0.10
from flutter-custom-image-crop.
Related Issues (20)
- Disable rotating HOT 5
- how to do aspect ratio in this package? HOT 3
- Initial scaling HOT 2
- onCropImage return bytes with black image on web HOT 3
- CustomCropShape - Ratio HOT 1
- [Feature Request] CustomPaint for drawPath
- [Feature request] Rounded corners for Square and Custom ratio
- Update SolidCropPathPainter make paint style config able like DottedCropPathPainter
- [Feature request] create tool to generate Custom paths. HOT 3
- Photo behavior in the cropping area HOT 10
- why crop result always is square HOT 8
- [Bug] Crop Image by ratio not resizing image to width and height HOT 5
- apply crop on the initial image given by the input path HOT 1
- Have background white after crop to circle HOT 1
- Landscape crop area shape and portrait images - initial fit by height
- Too slow cropping and result is too big HOT 4
- Crop bug if Ratio width < height HOT 5
- SVG image pick and crop HOT 1
- Overlay color affects the Image HOT 1
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 flutter-custom-image-crop.