chooyan-eng / crop_your_image_gallery Goto Github PK
View Code? Open in Web Editor NEWA sample app to explain what you can do with "crop_your_image" Flutter package.
A sample app to explain what you can do with "crop_your_image" Flutter package.
I had to close VS code even after I stopped the debugging session since it's so laggy. So it's impossible to copy-paste the message. The freeze happened after onCropped is called.
This is my cropper page code:
import 'dart:typed_data';
class CropperPage extends StatefulWidget {
final String title;
final Uint8List image;
final double aspectRatio;
final bool isCircle;
const CropperPage({
Key? key,
required this.title,
required this.image,
required this.aspectRatio,
required this.isCircle,
}) : super(key: key);
@override
_CropperPageState createState() => _CropperPageState();
}
class _CropperPageState extends State<CropperPage> {
bool _isProcessing = false;
final CropController _cropController = CropController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(widget.title)),
floatingActionButton: FloatingActionButton(
backgroundColor: Colors.green,
onPressed: () {
setState(() {
_isProcessing = true;
});
_cropController.crop();
},
child: Icon(Icons.done),
),
body: _isProcessing
? Padding(
padding: const EdgeInsets.all(16),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 14,
height: 14,
child: CircularProgressIndicator(strokeWidth: 2),
),
const SizedBox(
width: 16,
),
Text('Processing')
],
),
)
: Crop(
image: widget.image,
onCropped: (value) {
setState(() {
_isProcessing = false;
});
Navigator.of(context).pop(value);
},
aspectRatio: widget.aspectRatio,
withCircleUi: widget.isCircle,
controller: _cropController,
),
);
}
}
This is the image
If the crop widget does not reach all the way to the sides of the screen, then it is possible to drag corner circles outside of widget area. If you drop the circles there, there's no way to get them back again.
Probably what should happen is that when the crop area hits the side of the widget, dragging should stop -- and the circles should "push in" from the sides and top/bottom of the widget, so that they are always shown.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.