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

Portrait images do not fill the available space on iPad #29

Open
1 task done
lupusyon opened this issue Aug 27, 2023 · 0 comments
Open
1 task done

Portrait images do not fill the available space on iPad #29

lupusyon opened this issue Aug 27, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@lupusyon
Copy link

Contact Details

[email protected]

What happened?

I'm not sure this is a bug, perhaps is me missing something about the way this widget works, but I thought I'd ask after several unsuccessful attempts at fixing it, I hope it's ok.

I'm using the carousel to display a gallery of images I fetch from the web via a backend service. I set the viewportFraction to 1.0, so the "slides" are expected to fill the available horizontal space, and that's what happens on iPhone, check the following screenshot (some parts are edited for privacy and NDA):

iphone14pro

On the left you see a landscape gallery picture, on the right a portrait one. As you can see they both fit the whole screen horizontally, the latter simply expands the carousel area downwards to accomodate the different aspect ratio, which is perfect for me.

But here's what happens when I run the app on an iPad Pro (6gen):

iPadpro6th

As you can see, the landscape picture fits perfectly, while the portrait one gets those weird paddings (you can also see the spinner loading animation I put in an underneath container of the same stack because the gallery image doesn't cover it anymore).

Here is the code I use:

ExpandableCarousel(
options: CarouselOptions(
autoPlay: false,
viewportFraction: 1.0, //full width
),
items: imgGallery.map((i) {
return Builder(
builder: (BuildContext context) {
var noimg = AssetImage(//default placeholder
'assets/images/noimg.png');
var img;
if (i != '') {
img = NetworkImage(i);
}
return Image(
image: i != '' ? img : noimg,
);
},
);
}).toList(),
),

Any suggestions? Thanks in advance

Version

2.1.0

What devices are you seeing the problem on?

iPhone

OS

iOS 16.4

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@lupusyon lupusyon added the bug Something isn't working label Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants