Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Added enablePanAlways to allow the user pan any view without restrictions. #427

Merged
merged 3 commits into from
Jun 3, 2021

Conversation

diegoveloper
Copy link
Contributor

I added an option to allow us to pan the widget without any restriction.

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: ClipRect(
        child: Container(
          height: 300,
          color: Colors.white,
          child: PhotoView.customChild(
            backgroundDecoration: const BoxDecoration(color: Colors.transparent),
            enableRotation: true,
            minScale: _minScale,
            maxScale: _maxScale,
            enablePanAlways: true,
            child: FlutterLogo(),
          ),
        ),
      ),
    );
  }
}

Before
https://user-images.githubusercontent.com/4898256/120548459-fc0bdf00-c3b7-11eb-8fb7-ee7612cc0e48.mov

After
https://user-images.githubusercontent.com/4898256/120548469-ff06cf80-c3b7-11eb-999a-37c7d90b4504.mov

@renancaraujo renancaraujo merged commit 92605e3 into bluefireteam:master Jun 3, 2021
@jjkavalam
Copy link

Thank you ! Could it be possible to make a release with this feature ?

I am looking to implement an UI that allows users to select a part of the image as their profile picture. This feature combined with existing functionality in https://pub.dev/documentation/photo_view/latest/photo_view/PhotoView-class.html#controllers will get the job done 🎉

@TheJulianJES
Copy link

So this also reverted #420?

@Jackjun724
Copy link

oh my god, #420 fix master api bugs, It's reverted here, I think it's error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants