How do i build an AppBar that has a background image and overlay text on it and a TabBar on the bottom which gets pinned on scroll? - flutter

I want to build something that is similar to the Masterclass app which has a background image and a tab bar which gets pinned to the top while scrolling down and the background image has overlay text which scrolls without affecting the background image. I want to replicate this in Flutter and need some help. Anyone who has an idea to replicate this UI would be of significant help.

To set up the static background image, we need to use the Stack widget which allows to layer its children. And the NestedScrollView widget for nested scroll views. You can find explanation and code here

Related

Flutter Detect whether there is content behind AppBar whilst scrolling

Is there an easy way to detect when there is content behind a fixed container that is floating on top of a ScrollView.
In native iOS apps, the background of the TabBar and NavigationBar are only visible when there is actually content behind them. So the NavigationBar will fade in it's background as the user scrolls down.
Whilst this can be calculated to provide the scroll position of when to add opacity to the NavigationBar Background, it is much more complicated with any form of bottom bar as it would have to know the total length of the scroll window as well as calculate the bounce scroll offset at the top.
As much as all this can be calculated in theory, is there an easy way. A way of detecting when there is content behind another element.
You will need to pass a ScrollController to your scroll view and then listen to the scroll value and change the state of the appbar.
Example:
scrollController.addListener(() {
//Check offset value
if(scrollController.offset > 10) {
//Change transparency here
setState(() {
...
});
}
});
Adapting this to your use case it should work

How do I add a blur effect at the top and bottom edge of vertical scrollView in flutter

I'm Trying to implement a vertical Scroll view with multiple items inside. Currently the scroll view works just fine but the edges seems to be very sharp and its cropping like this while scrolling,
instead I need to blur the top and bottom edge.
I'm looking for something similar to this answer https://stackoverflow.com/a/61151054/12890791, but this answer is for horizontal scroll.
Make the appBar transparent, set elevation to zero. In the scaffold, set extendBody and extend bodyBehind appBar to true

Autolayout in tabs

Tab Bar
I want Chat image in between that menu and people image and fire image in between menu and notification image using autolayout.
I have applied leading, center vertical, fix width and fix height o Chat image
For fire image I have given trailing and remaining same as chat image.
Note: This is not tab bar this is custom view.
Above problem solved but now in iPhoneX am getting
that bottom bar is hidden
How can i come out from this issue?
Create a container with leading and trailing - 0 - to surrounding images(people and menu), and center horizontally the image (chat) inside this container.
or:
chat.center = CGPoint(menu.frame.minX - people.frame.maxX)
If you are creating view programatically then make sure buttons in view have aspect ratio with screen width.
Why don't you use Horizontal Stack View.
See below image

iOS - Display UINavigationBar drop shadow behind UITableViewCell

I have followed the answer provided here to create a drop shadow for my UINavigationBar. However, the shadow is above the UITableCell that is directly below the bar (image). How would I go about making the cell cover up the shadow, so that the shadow of the bar is only visible if you scroll up?
The simplest thing you can do is to create a background image using Photoshop (or a similar application) leaving 44px (88px for the retina display) from the top and making the shadow start from there.
Then just use that as a backgroundColor of your window.
The NavBar in the image will be covered from the actual navigationBar and only the shadow will be visible (beneath the tableView as you asked.)
I dont know why you want to make the shadow only visible if scrolling up, but may be you can set UIScrollViewDelegate to the table view and deal with the event when the table view scrolling up and set shadow of navigation bar, remove shadow when scrolled to top.

What is the best way to implement a widget like this in iPhone SDK?

alt text http://img696.imageshack.us/img696/4453/screenshot20100505at125.png
At first we thought of have a back bar and a front bar and simply grow the front bar as the bar progresses. But then we realized that the front bar cannot "stretch" because it has a flat end, and the flat end will be taller than the back bar when it reaches near the end.
How would you implement this bar in the iPhone SDK?
I would do the same as Sophtware but with a bit more sophistication, since the background below the progress bar also seems to be an image view, having a bit of gradient on right side.
From bottom to top, I would have:
1) at the very bottom - background of the progress bar, stationary. It can be larger than the progress bar area since it will have stuff sitting on top of it.
2) the progress bar rectangle with border, shadow, gradient etc - as Sopthware says, you would slide this left and right for desired "progress"
3) the top layer - the bezel around the progress bar, with a hole (transparent area) in the middle, from where both the progress bar and background would be.
EDIT: you mentioning the background being UIToolbar changes things a bit. The easiest way implementation-wise would actually to produce all the possible states of the widget as one monolithic image. At runtime, you would simply swap the images. The widget is sufficiently small that this would not have an impact on the app size, and should be fine if you don't want to do complex animation or anything like that.
There are other ways of doing it that would involve breaking the image into pieces, but as you mention, those will be more dependent on the UIToolbar color. Producing it as a monolithic image will work with any toolbar color.
You could use two image views. The top one would be everything with the progress part knocked out, which would have that area set to transparent. The second image view would be rectangle of the entire progress portion. Then just slide the progress part under the top view to get the desired affect.