GithubHelp home page GithubHelp logo

agoradesk-localmonero / insta-image-viewer Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 12.0 18.48 MB

Flutter package - a simple widget for full screen with swipe to dismiss, pinch & zoom.

License: Apache License 2.0

Kotlin 0.29% Swift 0.93% Objective-C 0.09% Dart 30.33% HTML 9.04% CMake 18.93% C++ 38.71% C 1.69%

insta-image-viewer's People

Contributors

awaik avatar sergdeus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

insta-image-viewer's Issues

Circle shaped image unexpected behaviour

I have been trying to use insta-image-viewer with an image that's given a circular shape (profile picture image) however, I haven't been able to find a way for the plugin to open the full photo correctly when pressing on it.

I've tried all of the following options (and more):

  1. When opening it, it keeps the circle shape and "zooms into the image"
SizedBox(
  width: 100,
  height: 100,
  child: InstaImageViewer(
      disableSwipeToDismiss: true,
      child: CircleAvatar(
        backgroundImage: widget.otherUserPfpUrl.isNotEmpty
            ? NetworkImage(widget.otherUserPfpUrl)
            : Image.asset(
                'assets/images/defaultPfp.png',
                scale: 3,
              ).image,
      )),
),
  1. Same as previous
InstaImageViewer(
  disableSwipeToDismiss: true,
  child: Container(
    width: 100,
    height: 100,
    decoration: BoxDecoration(
        shape: BoxShape.circle,
        image: DecorationImage(
          fit: BoxFit.cover,
          image: widget.otherUserPfpUrl.isNotEmpty
              ? NetworkImage(widget.otherUserPfpUrl)
              : Image.asset(
                  'assets/images/defaultPfp.png',
                  scale: 3,
                ).image,
        )),
  ),
),
  1. When opening it, different behaviours depending on "fit" parameter, works well with options like "BoxFit.none" when opening the image, but of course, does not work properly for the circular image before opening it...
SizedBox(
  width: 100,
  height: 100,
  child: InstaImageViewer(
      disableSwipeToDismiss: true,
      child: ClipRRect(
          borderRadius: BorderRadius.circular(300.0),
          child: Image(
            fit: BoxFit.cover,
            image: widget.otherUserPfpUrl.isNotEmpty
                ? NetworkImage(widget.otherUserPfpUrl)
                : Image.asset(
                    'assets/images/defaultPfp.png',
                    scale: 3,
                  ).image,
          ))),
),
  1. Same as previous, behaviour depends on "fit" parameter
ClipRRect(
  borderRadius: BorderRadius.circular(300.0),
  child: SizedBox(
    width: 100,
    height: 100,
    child: InstaImageViewer(
        disableSwipeToDismiss: true,
        child: Image(
          fit: BoxFit.cover,
          image: widget.otherUserPfpUrl.isNotEmpty
              ? NetworkImage(widget.otherUserPfpUrl)
              : Image.asset(
                  'assets/images/defaultPfp.png',
                  scale: 3,
                ).image,
        )),
  ),
),

I just can't find a way to keep the circular shape, but later respect the original image when opening it...

Is there any way to achieve this?

Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.