Proper way, that make a screen scrollable if the content is greater than the screen - Flutter - flutter

I am looking for the proper way, how can I use scrollable view only if necessary.
I want to create a card which will have an 500 height container. In this case some small-screen device could not show the content properly specially if the keyboard is showing.
In this case the screen should be scrollable, but I cant find a good solution.
I used a SingleChildScrollView with a Column child. Inside the column there was the Card view with the content.

Related

Changing screen structure depending on screen size

I have a screen with following structure:
The first column is a TextField (search Text).
The third column is a static footer that should remain at the bottom of the screen.
The second column hosts several widgets.
My issue is that the second column throws a bottom overflowed by 96 px on small screen devices like iPhone 7, but on greater screen devices it is shown nice.
How could I avoid this issue on smaller screens?
there are different ways to solve your problem and 2 of them I'm listing below
1)
Each screen you can wrap with SingleChildScrollView() so, you can avoid overflowed error and it will be easily scrollable by user.
But with this solution it will not look good.
So, for that we can user 2nd solution which is
2)
You need to change your designing structure as per the screen height and width.
You can wrap particular widget with LayoutBuilder which will give you the available height and width which you can use.
So, with this technique you can build different structure for Tablets and mobiles. Which make your app really attractable.

How to create a Fixed Scrollable portion in CusotmScrollView in flutter?

I am using a CustomScrollView and Slivers inside it and redendering the list using SliverChildBuilderDelegate. This works fine, but my requirement is to have a Fixed Container of height = height of screen/2 and inside that I want to render a list and and it can scroll as well, I am using CupertinoSliverNavigationBar [this cannot be replaced]. I am able to draw a Container and inside that I am able to show a list using Listview.builder, but the problem is I am unable to scroll the list, whenever I scroll it, it goes to top again, I want something Like, my CustomScrollView should be kept as it is, just I want to create a Scrollable Container of fixed height and the list inside that should scroll properly and CustomScrollView can also scroll, I have tried many widgets like Wrap, Rows, Columns, SingleChildScrollView, also tried NeverScrollPhysics() Behaviour for CustomScrollView but nothing is working out. Please Help!

Flutter scrollable list inside overlay

My question is similar to this How to make my page scrollable when i show overlay element, that have too many items in flutter? but it has no answers so I'll try to ask as well:
I have an Overlay showing a list of questions using ListView. The list of questions is long and I need to enable scrolling inside the Overlay.
Now it's static and part of it disappears at the bottom of the mobile device.
Why is not just scrollable (since the list inside the Overlay is inside a ListView) and is there a way to make it scrollable?
Thanks in advance for any help!
UPDATE (SOLVED) :
The problem was that the ListView widget is inside a Positioned widget and the top, left, bottom and width values (in my case) need to be set in order for the content to be scrollable.
The problem was that the ListView widget is inside a Positioned widget and the top, left,bottom and width values (in my case) need to be set in order for the content to be scrollable.

How to keep the scrolling position when adding a new elements in the top using ListView or CustomScrollView in Flutter

Is it possible to add new elements into the top of the ListVeiw or CustomScrollView and keep the scroll position as it's with Flutter
I've tried the following
extentAfter = _scrollController.position.extentAfter;
_scrollController.jumpTo(_scrollController.position.maxScrollExtent - extentAfter);
but this won't work well with SliverAppBar - floating and its actually not optimal solution.
Actually the cleanest way would be to add those items only when user scrolls back to the top of the ListView. You can cache them in memory for the moment user is far enough from the top (in your case) of the list.

Twitching Scrollbar in listview with dynamic height children

Code example: https://gist.github.com/v1z4/4c231063b9e22eac5961fb0c437119fe
I have a list of dynamic elements with different height, and I need to have a scrollbar. I use iOS style widgets, so I have wrapped ListView in CupertinoScrollbar().
I test it in real device attached, because simulator does not have scrollbar.
The list works fine, but scrollbar is twitching, because the height of elements are different.
It works fine when I add fixed height to container in ListView element, but text is being cropped and looks bad. Is there a way to fix twitching?