limiting images inside container

62 views
Skip to first unread message

Neail

unread,
Mar 1, 2021, 12:52:56 AM3/1/21
to Flutter Development (flutter-dev)
I am struggling with limiting the image inside the container I want to show the image from firebase or google drive (don't know if that commercially viable).

Anyway, whenever I use Media query with aspect ratio constrain, but the image doesn't show up. 

Then I tried limiting the container width but the image doesn't limit rather cropped inside the container

I came to know that _limitsize but don't know how to use and if that is the appropriate solution! 
I am also not sure if list view  is required.

PLease help me.


Here I am attaching the code link 

Suzuki Tomohiro

unread,
Mar 1, 2021, 8:22:31 AM3/1/21
to Neail, Flutter Development (flutter-dev)
Are you looking for SizedBox and FittedBox?

If not, can you share what your UI looks and the drawing of your desired UI?

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/23542c9f-8c03-4e2c-9602-81086cc05415n%40googlegroups.com.

Neail

unread,
Mar 1, 2021, 12:25:55 PM3/1/21
to Flutter Development (flutter-dev)
Mr Suzuki

Thank you for responding.
Here I am attaching my desired look and also what I am getting.
I am using the main.dart to arrange them, I have shared just that scrollable row 

Another Question should I use DraggableScrollable Widget for the region in Grey?
image (1).png
image.png

Suzuki Tomohiro

unread,
Mar 1, 2021, 12:39:21 PM3/1/21
to Neail, Flutter Development (flutter-dev)
Your example looks good to me. It’s showing images within the bottom sheet. Which part is not working for you?

Neail

unread,
Mar 2, 2021, 1:34:14 AM3/2/21
to Flutter Development (flutter-dev)
I am sorry but that is not what I intended, the container there is taking the whole screen, there should be multiple images in that row.

Fortunately, I have solved it...


Solution - ( if anyone finds this useful )The container parameters were previously defined by the media query.  Which fetches the original image or video dimensions and sizes container accordingly. To force limit the container one must define the hight & width parameters as desired. ** keep in mind that the aspect ratio either match or should be bigger than that of the original image, otherwise it would look like my second image. (the blue colour is from the empty container ) .


Thank you Mr Suzuki, thank you for your time and interest.
1.png
2.png

Suzuki Tomohiro

unread,
Mar 2, 2021, 8:44:42 AM3/2/21
to Neail, Flutter Development (flutter-dev)
Glad to hear you solved the problem.

Reply all
Reply to author
Forward
0 new messages