I want a CustomScollView with flexible Header where the items while scrolling vanish/appear smoothlyt by overlaying the top and bottom limit of the SliverList with a gradient that ranges from transparent to the color of the rest of the page.
Like in the this schematic layout.
At the bottom this was possible without any problems by placing the Container with the gradient inside a Stack with overlap=true and positioning it outside the Stack.
I tried the same inside the SliverAppBar's flexiSpace but it did not allow that the gradient container overlapped its limits instead it was clipped.
Is there an easy way to accomplish it? I found a solution by using a Stack around everything and position the gradient container there by listening to the moving of the flexispace but that seems a bit cumbersome.
Related
Trying to implement this kind of look in Flutter:
Currently, I have a Row with Expanded images in it. So they both share half of the container without padding. The next step is an angled divider between them.
How would you go about it? I understand something like ClipPath is involved here, but I am not entirely sure how to approach the task.
You can consider these two pictures as 2 layers, one on top, and the other one on the bottom. You can use Stack to stack them like that. You can then use ClipPath like you said, to clip the top layer, so some parts of the bottom layer would become visible. The key takeaway is to use a Stack instead of using a Row widget, otherwise the 2 pictures would be on the "same level" and clipping one would not reveal the other.
I am trying to reproduce this navigation bar (made on figma) with flutter :
I have already done the background shape with the CustomPaint class, however I cannot reproduce the shadow.
As you can slightly see, the border isn't equal along all borders, there is more shadow inside the half-circle in the middle than on the top border parts.
Also, I cannot control the blur and spread values (as with figma). Is there a way to achieve what I am trying to do. Or did I missed something ?
I am trying to build a screen that looks similar to the following:
The main functionality I am looking for is that:
It is scrollable
There is an image in the top half of the screen
Below the image is a container with other information in it. The top of the container should overlap the bottom of the image and have rounded borders.
Would any one be able to help me with this. I've been trying stacks, with positioned container and images within singlechildscroll views but not getting anywhere at all right now.
Any help would be really appreciated.
Many thanks
I am coding a website with Flutter. My layout uses "blocks" of vertical content laid within a SingleChildScrollView. They look like rectangles of content (with images, text, buttons, etc in them), taking up the whole screen horizontally, and the whole screen vertically.
Currently, whenever I move the screen size around (drag the web window to be different sizes) the website breaks. If I move it to be really small horizontally, I cannot fit in the content I need, if I move it to be small vertically I get overflow errors (and vice versa). This is because I am using MediaQuery.of(context).size.height/width to layout my website.
My rectangular blocks of "content" all have their same respective parent: Container(width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height) so they completely adjust everytime I move the window. Is there a better way to implement responsive web? Would it be better to just specify (for example) 620 pixels height for the Container and double.infinity for the width? And then somehow make everything fit inside not overflow/look weird? Also, when I drag the bottom of the web window nothing expands/grows properly because at that same time all my "content blocks" are all resizing their height because I am technically resizing the screen.
Finally, I've tried using BoxConstraints's minHeight, maxHeight, minWidth, and maxWidth, yet they don't seem to work and still produce the yellow/black overflow lines when testing in a webview. Huh?
Also, how would I get a bottom scrollbar to appear horizontally once my webview window is fully dragged close horizontally and half my content is cut off, but I still would like to see it. Would this be necessary? Or would another solution not need this? I'm not sure...
How are other people working around this and achieving this? I feel like I am doing this completely wrong. It shouldn't be this difficult.
(Also, using LayoutBuilder I have 2 additional builds for mobile/tablet when the screen width reaches less than 1100px)
I'm using curved_navigation_bar : this one
I have an animatedContainer that shrink to 1/4 of its size, and it has an Curved Navigation Bar,
when the Container shrinks the navigation bar draws a little bit outside of the container, I need a way to stop it.
attached: screenshot of the problem, you can see in a blue circle the extra drawing it does and that I need to stop.
I've searched the web for solution and even tried to examine the source code but with no luck
The solution given by #pskink
using clipRRect ( or clipReck ) and inside of it put the entire child of the AnimatedContainer, will resolve this problem perfectly!