Flutter Compress Camera Image

Solution for Flutter Compress Camera Image
is Given Below:

I want to click the photo through camera and want to compress it and then upload it to the server

i have included the Image Compress Dependency its Showing me the error The getter ‘absolute’ isn’t defined for the type ‘PickedFile’.

written the code of Clicking photo and uploading it to server
// Taking Photo From Camera

Widget bottomSheet() {
return Container(
  height: 100.0,
  width: MediaQuery.of(context).size.width,
  margin: EdgeInsets.symmetric(
    horizontal: 20,
    vertical: 20,
  child: Column(
    children: <Widget>[
        "Take A Picture",
        style: TextStyle(
          fontSize: 20.0,
        height: 20,
      Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
        // ignore: deprecated_member_use
          icon: Icon(Icons.camera),
          onPressed: () {
          label: Text("Camera"),

void takePhoto(source) async {
final pickedFile = await _picker.getImage(
  source: source,
setState(() {
  _imageFile = pickedFile;
await FlutterImageCompress.compressWithFile(
  minWidth: 2300,
  minHeight: 1500,
  quality: 94,
  rotate: 90,

Instead of using FlutterImageCompress.compressWithFile just add imageQuality in the _picker.getImage

      minWidth: 2300,
      minHeight: 1500,
      imageQuality: 75

As with the image quality value size of the image get changed