Skip to content

codetoart/cta-flutter-image-crop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image_cropper

A flutter package to scale and crop images. Optionally set aspect ratio of cropping area

Demo

Documentation

Installation

Add image_cropper to your pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter

  # added below
  image_cropper: <latest version>

Adding to app

When you have the image file navigate to Crop widget provided by the package

Future<Null> _cropImage() async {
    var file = await imageFile.readAsBytes();
    Navigator.of(context).push(MaterialPageRoute(
      builder: (context) {
        return ic.Crop(
          controller: _cropController,
          image: file,
        );
      },
    )).then((image) {
      setState(() {
        if (image != null) {
          croppedImage = image;
          state = AppState.cropped;
        }
      });
    });
  }
          

Author

CodeToArt Technology

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages