xclud / flutter_crop

Crop any widget/image in Android, iOS, Web and Desktop with fancy and customizable UI, in pure Dart code.
https://pub.dev/packages/crop
MIT License
257 stars 84 forks source link

Two finger rotation gesture support + updatedCallback #30

Closed sanjul closed 4 years ago

sanjul commented 4 years ago

Two finger rotation gesture support

Example:

class _MyHomePageState extends State<MyHomePage> {
  var controller;
  double _rotation = 0;

  @override
  void initState() {
    super.initState();

    controller = CropController(
        aspectRatio: 1000 / 667.0,
        updatedCallback: () {
          // This will update the slider when rotated with two fingers
          setState(() {
            _rotation = controller.rotation;
          });
     });
  }

   // --- More code --
}

updatedCallback is ofcourse, optional.

rotate_pull_request

sanjul commented 4 years ago

Hi @xclud

This is a fresh PR after closing my outdated PR for the same thing, that gathered dust and conflicts during its time sitting there 😅

You have done amazing work with this plugin ❤️ 💯 I'm using flutter_crop in an app I'm working on; also having a gesture rotate makes so much difference for my use case at least!

Not to hurry, but kindly let know if this looks good, that'll be helpful.

Thank you!

xclud commented 4 years ago

Hi @sanjul , I appreciate your great work. Could you please create separate PRs for each feature? you may fork the project and give it a branch name (e.g. add-update-callback or rotation-gesture).

Also, updatedCallback name does not follow flutter's best examples. I suggest onChanged for its name.

Thanks.

sanjul commented 4 years ago

Hi @xclud

Thank you for the feedback! really appreciate it!

Closing this PR, Created separate PRs for each feature (https://github.com/xclud/flutter_crop/pull/31 and https://github.com/xclud/flutter_crop/pull/32 )

Also have made the suggested change and some more!

Thanks