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

hello, when I use custom child,the image size can not be set #544

Open
z1047549075 opened this issue Nov 2, 2023 · 0 comments
Open

hello, when I use custom child,the image size can not be set #544

z1047549075 opened this issue Nov 2, 2023 · 0 comments

Comments

@z1047549075
Copy link

when the image size is small,but when I use like this:

builder: (BuildContext context, int index) {
                  return PhotoViewGalleryPageOptions(
                    imageProvider: CachedNetworkImageProvider(
                        'http://168.168.13.70:9500/dashboard/?action=accessFile&path=/.dj_data/temp/IMG_0578.HEIC-small.jpg'),
                    initialScale: PhotoViewComputedScale.contained,
                    minScale: PhotoViewComputedScale.contained * 0.8,
                    maxScale: PhotoViewComputedScale.covered * 4.1,
                  );
                }

it can be fill the box.

but,when I use customchild:

builder: (BuildContext context, int index) {
                  return PhotoViewGalleryPageOptions.customChild(
                    
                    initialScale: PhotoViewComputedScale.contained,
                    // minScale: 1.0,
                    // maxScale: PhotoViewComputedScale.covered * 4.1,
                    // child: futureImage(index),
                    child: Container(
                      color: Colors.lightGreen,
                      child: Image(
                        width:750,
                        image: CachedNetworkImageProvider(
                              'http://168.168.13.70:9500/dashboard/?action=accessFile&path=/.dj_data/temp/IMG_0578.HEIC-small.jpg'),
                      ),
                    ),
                  );
                },

the width:750 is don't work,it is show the img's original size
I mean.i want small image can be fill the parent box...just like PhotoViewGalleryPageOptions show

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

No branches or pull requests

1 participant