How create blur gradient? - flutter

I have created a blur effect in Flutter on the bottom tool bar of a scroll list. For this I used BackdropFilter with ImageFilter.blur().
The effect looks nice but I don't like the hard edge between the blurred and non-blurred area. I'd like a gradual transition between sharp and blurred.
I noticed that on the bottom of the screen this effect is somehow already there, you can read the number (see picture below, iPhone 11 sim). Seems to be some bug.
I've tried lots of stuff, anyone any idea on how to create this effect on the top edge?

Related

Getting a round blur halo around a square button in order to place over an image

I updated this with an image of what I am trying to achieve, its a blur on a image which adds a touch of shading and even white on white is visible. I am basically working on putting buttons of various kinds on top of images and welcome's any and all assistance on best practices. I know facebook does this in some way as an app example.
To summarize what I am trying to achieve. I have an image that takes up the full screen and I would like to place a button on top of that image that does something like blur around it with padding so that it looks clean on top of the image. My button is a heart png, red outline with clear inside, and is represented as a square because of the irregular shape. I would like the heart to be on top of a circle that does something like blur the image so it can always be seen.
I found a number of similar solutions to this problem using UIBlurEffect but nothing that specifically addresses the "square image" and how I would control making the blur circle larger/smaller in terms of the padding around the square. I tinkered with creating a UIView that was transparent, placing a circle with a blur into there and then adding the button with their centers aligned but this seems like an incorrect approach and wasn't quite working. I suspect that for people with expertise this is something where I just need to have the correct usage of the UIBlurEffect.

UIBlurEffect blur set color

I want to place a blur effect on top of a view with gradient. When I do so using the UIVisualEffectView combined with the UIBlurEffect light, I get the following result:
As you can see, the navigation bar is very bright. I'd like it to not be tinted with white color, or what this might be, but instead actually just blur the background.
I noticed that when dragging down the notification center / lockscreen on iOS 11, the blur is not so bright, even though the background gradient is exactly the same:
I was thinking this could be done using the tintColor property of UIVisualEffectView, but changing it did not have any effect whatsoever.
Is there any way I can reproduce the blur effect shown in the image above, using standard Swift libraries?
Edit
Since there haven’t been any responses whatsoever, I’m guessing there’s no way to do it natively.
If someone can recommend a good library, I’m open to that too.
Thanks!

Swift iOS UI Advice

I am looking for some general advice and maybe some example code of what I am trying to accomplish if anyone knows of any for an iOS swift project. I would like to either:
A) Make the background, of the blue view, gray and only show a certain percent of the blue area.
OR
B) Overlay the gray area on top of the blue view and just keep making gray area bigger.
What I am trying to do is simulate battery power and show a battery.
I've considered using a progress bar and doing option A, but the blue area is NOT a solid color. Its actually an image. I've tried using an image for the progress bar, but the image needs to keep its dimensions. (Ex: If progress shows 20% it needs to show only 20% of the image or "blue area", but if you use an image as the progress bar it just shrinks the image and still shows 100% of it instead of just the 20% I need to show).
You can easily write a custom self-drawing UIView that will behave in exactly the way you describe. In other words, you tell your UIView a percentage, and it redraws itself with the blue on the left and the gray on the right. You can even draw the darker gray stroke outline shown in your drawings. All easily accomplished in code.
I like being able to lay things out visually and take advantage of autolayout. Here's how I would do this (in a nib/storyboard):
Place a UIView on your canvas and give it the gray background. Give it whatever autolayout constraints are appropriate for you.
Place a UIView inside the one from #1 and give it the blue background. Anchor it's left, top, and bottom to the gray parent view and give it whatever width (doesn't matter).
Add an outlet to that width constraint you made in #2.
Now all you have to do is modify the "constant" property of that width constraint to give you the desired "progress". So if your gray view is 100 wide and you want to present "20%" progress, then just do "yourWidthConstraint.constant = 20".

How to add effects to UILabel

I've been searching for that many time ago and I can't find a solution. I have a animated label that crosses the screen of the iPhone (like the title of a song does in the Music app.Well, I'd like to add the "fade in/out" effect like the music app has. The easy solution is open Photoshop and create this simple image and then add it up to the label. Well, under the label I have an image with black backgroud. The image can be zoomed in and then the image with the fade in/out effect can be seen, and it doesn't look well. Is there any possibility to do this programatically? Thanks
PD: if there's another possibility rather than doing this programatically, I'll apreciate the answer as well.
Edit: Here's the image capture of the problem
I'll approach it in a non-programming way.
The image reference you gave us for the Music app you seem to be emulating has a different gradient than the one you drew in the second image.
If you notice in the image, the gradient has not fully completed its transition from clear to black before the words are cut off. I would say in photoshop run the gradient from clear to 80% alpha black and then draw a 100% alpha black rectangle to finish it off as per image. The white is just showing you what it looks like without the black background.
Now as for the zooming. Correct me if I am wrong, but it sounds like you want a viewing window for the image so that once you have zoomed into it, it will fade to either side, but still be viewable/movable in the center. This means that the image has to be zoom-able, but once you have zoomed the "fade in/out" should not be zoom-able.
Just make sure you aren't scaling the fader by keeping it separate from the scrollView of your background image.

thick shadow with no blur on UILabel

I am trying to add a thick shadow to a UILabel, without any blur. In photoshop I would use the "Spread" option to make the shadow look like this. It's for a comic book themed UI in an app I am developing. I cannot use images as the text is dynamic and different for each user.
Here is what I am after (on the left) and here is as far as I have gotten so far with CGShadowWithColor (on the right):
Anyone know how I can achieve this result?
A quick hack to try would be to have several black UILabels below the white one, each offset slightly.