i wanna shrink [ Description section ] when user scroll down.
like sliver appbar but reversed.
i expected to find flutter widget like sliver bottombar and i disappointed.
I want to Make Container() shrink when user scroll down the screen
and scroll up starting position make Container() expanded as first time.
How can i do this??
You could use AnimatedContainer https://flutter.dev/docs/cookbook/animation/animated-container (doc)
Also, you must use ScrollController https://api.flutter.dev/flutter/widgets/ScrollController-class.html (doc).
To listen for the scroll event, and each time when a user scrolls down/up maybe in some cases left/right, you will recalculate the height of your AnimatedContainer, and set a new state.
Related
I wanted my button to shift below the content when the keyboard opens or there is no space on the screen, and when there is more space it should stick to the bottom of the screen. For that, I use a CustomScrollView but now the jittery effect is there. How can I make this transition smooth?
Here is the video of the screen:
Rendered Screen
In order to align my button on the bottom of the screen, So I used a CustomScrollView with two sliver widgets SliverToBoxAdapter and SliverFillRemaining with hasScrollBody: false and aligned the button by wrapping in a Align and set alignment: Alignment.bottomCenter.
Widget Tree
I want to create a SliverAppBar with up scroll animation.
the children of sliverAppBar are resized depending on the height of silverAppBar and the text should be invisible in the small size like below (with animation)
Qst: what is the best way to implement it
I used the SliverAppBar before but wasn't that complicated like the current example.
its my first time working on something like this.
so any suggestion would be helpful
how to keep a specific container of a ListView on the top of the screen when scrolling down?
for example:
appBar
image1(inside the listview)
tabs(should stay below appBar but image1 disappears when scrolling down)
list item 1
list item 2
....
navBar
You have to work with SliverList and SliverAppBar to achieve a layout like that.
Read more about it in this article.
I am trying to make a design similar to this Scroll Effect
Any ideas on how to do this?
What I tried (failed): Vertical scrolling pageview where the middle child is a SingleChildScrollview. But the SingleChildScrollview stops the vertical pageview from working.
I tried adding a scroll controller to the Scrollview in the PageView, and animatedJumpToPage when I reached the bottom of the scrollview, but this has an ugly effect and theres gotta be a better way to do this
Try using a ListView widget. It easily allows you to have a vertical scroll mechanism without adding any controllers or anything complicated.
How to prevent Textfield scrolling when text is longer then screen height the problem is that I have CustomScrollView inside of it horizontal ListView and textfield and I want that when you scroll text inside textfield it would scroll with ListView now it scrolls just text and leaves ListView pinned to the place, but if you scroll while tapping outside textfield it works as expected.
Seems that nested scrollview would solve such problem but no idea how to implement it with two child widgets
You can use a NestedScrollView and a controller and then ListView will work.